tx · BScUsiBLP6gU4Ko6hMoe5DAi6mcgpzp5pEVTgL2DkrWq

3MtQw51ChuPVJckfoZkuvqn73UiXDZSRmvi:  -0.04300000 Waves

2023.08.17 16:15 [2714640] smart account 3MtQw51ChuPVJckfoZkuvqn73UiXDZSRmvi > SELF 0.00000000 Waves

{ "type": 13, "id": "BScUsiBLP6gU4Ko6hMoe5DAi6mcgpzp5pEVTgL2DkrWq", "fee": 4300000, "feeAssetId": null, "timestamp": 1692278095088, "version": 2, "chainId": 84, "sender": "3MtQw51ChuPVJckfoZkuvqn73UiXDZSRmvi", "senderPublicKey": "DW6wmKbzcE2fCwMjuV8anYx2tWHumv6MPCvzbxXtFPYF", "proofs": [ "2zmSvJvTL7zoNnVpuMBacDBNJgBJnFYeUMY9KjzWfmjuP41WNZimLjj7Zov51pgCTRuTzJWbuwo9Gu7mDcifV3af" ], "script": "base64:BgK2OAgCEgASBQoDAQQBEgcKBQEEAQgBEgQKAgEEEgMKAQESBAoCAQQSBAoCCAESBAoCCAESBAoCCAESBQoDAQgBEgASBAoCAQESAwoBARIFCgMBAQESBAoCCAgSABIAEgMKAQgSBQoDAQEBEgQKAgEBEgQKAggBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgASAwoBARIDCgEBEgQKAggBIgpsUGRlY2ltYWxzIgZzY2FsZTgiDHNjYWxlOEJpZ0ludCIHc2NhbGUxOCIKemVyb0JpZ0ludCIEYmlnMCIEYmlnMSIEYmlnMiILd2F2ZXNTdHJpbmciA1NFUCIKUG9vbEFjdGl2ZSIPUG9vbFB1dERpc2FibGVkIhNQb29sTWF0Y2hlckRpc2FibGVkIgxQb29sU2h1dGRvd24iDmlkeFBvb2xBZGRyZXNzIg1pZHhQb29sU3RhdHVzIhBpZHhQb29sTFBBc3NldElkIg1pZHhBbXRBc3NldElkIg9pZHhQcmljZUFzc2V0SWQiDmlkeEFtdEFzc2V0RGNtIhBpZHhQcmljZUFzc2V0RGNtIg5pZHhJQW10QXNzZXRJZC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CYU0HBQJhTgcGCQECYUoEBQJhSwUCYUwFAmFNBQJhTgMJAAECBQJhUQIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAmFWBQJhUQMJAPQDAwgFAmlrCWJvZHlCeXRlcwkAkQMCCAUCaWsGcHJvb2ZzAAAFAmltBgQCaXAJAPYDAQkBBXZhbHVlAQgFAmFWBnNjcmlwdAQCaXEJANsEAQkBBXZhbHVlAQkAnQgCBQJiZAkBAmFGAAQCaXIJAPEHAQUEdGhpcwMJAAACBQJpcQUCaXAJAQIhPQIFAmlyBQJpcAcJAPQDAwgFAmlrCWJvZHlCeXRlcwkAkQMCCAUCaWsGcHJvb2ZzAAAFAmltDP/3ew==", "height": 2714640, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HzMa2qxMnBANL773LnZEUHkrjPxW9ZcvRmaxik8z5LTy Next: 8bCfc9neX55HZs9xmAFcPXVYpSdQaSRtQc8CJhV8dmc5 Diff:
OldNewDifferences
947947 then @
948948 else throw(($getType(@) + " couldn't be cast to String"))
949949 }
950- let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
950+ let isPoolSwapDisabled = {
951+ let @ = invoke(factoryContract, "isPoolSwapDisabledREADONLY", [toString(this)], nil)
952+ if ($isInstanceOf(@, "Boolean"))
953+ then @
954+ else throw(($getType(@) + " couldn't be cast to Boolean"))
955+ }
956+ let isSwapDisabled = if (if (isGlobalShutdown())
957+ then true
958+ else (cfgPoolStatus == PoolShutdown))
959+ then true
960+ else isPoolSwapDisabled
961+ let checks = [if (if (!(isSwapDisabled))
962+ then true
963+ else isManager(i))
964+ then true
965+ else throwErr("swap operation is blocked by admin"), if ((value(i.payments[0]).amount >= cleanAmountIn))
951966 then true
952967 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
953968 then true
10501065 else throw("Strict value is not equal to itself.")
10511066 }
10521067 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1053- let $t04468345145 = refreshKLpInternal(0, 0, 0)
1054- if (($t04468345145 == $t04468345145))
1068+ let $t04500745469 = refreshKLpInternal(0, 0, 0)
1069+ if (($t04500745469 == $t04500745469))
10551070 then {
1056- let updatedKLp = $t04468345145._2
1057- let refreshKLpActions = $t04468345145._1
1071+ let updatedKLp = $t04500745469._2
1072+ let refreshKLpActions = $t04500745469._1
10581073 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10591074 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10601075 then {
10911106 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10921107 if ((currentKLp == currentKLp))
10931108 then {
1094- let $t04575745822 = refreshKLpInternal(0, 0, 0)
1095- let refreshKLpActions = $t04575745822._1
1096- let updatedKLp = $t04575745822._2
1109+ let $t04608146146 = refreshKLpInternal(0, 0, 0)
1110+ let refreshKLpActions = $t04608146146._1
1111+ let updatedKLp = $t04608146146._2
10971112 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10981113 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10991114 then (state ++ refreshKLpActions)
11401155 then {
11411156 let userAddress = i.caller
11421157 let txId = i.transactionId
1143- let $t04701047162 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1144- if (($t04701047162 == $t04701047162))
1158+ let $t04733447486 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1159+ if (($t04733447486 == $t04733447486))
11451160 then {
1146- let paymentInAmountAsset = $t04701047162._5
1147- let bonus = $t04701047162._4
1148- let feeAmount = $t04701047162._3
1149- let commonState = $t04701047162._2
1150- let emitAmountEstimated = $t04701047162._1
1161+ let paymentInAmountAsset = $t04733447486._5
1162+ let bonus = $t04733447486._4
1163+ let feeAmount = $t04733447486._3
1164+ let commonState = $t04733447486._2
1165+ let emitAmountEstimated = $t04733447486._1
11511166 let emitAmount = if (if ((minOutAmount > 0))
11521167 then (minOutAmount > emitAmountEstimated)
11531168 else false)
11671182 let sendFee = if ((feeAmount > 0))
11681183 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11691184 else nil
1170- let $t04774847945 = if ((this == feeCollectorAddress))
1185+ let $t04807248269 = if ((this == feeCollectorAddress))
11711186 then $Tuple2(0, 0)
11721187 else if (paymentInAmountAsset)
11731188 then $Tuple2(-(feeAmount), 0)
11741189 else $Tuple2(0, -(feeAmount))
1175- let amountAssetBalanceDelta = $t04774847945._1
1176- let priceAssetBalanceDelta = $t04774847945._2
1177- let $t04794848056 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1178- let refreshKLpActions = $t04794848056._1
1179- let updatedKLp = $t04794848056._2
1190+ let amountAssetBalanceDelta = $t04807248269._1
1191+ let priceAssetBalanceDelta = $t04807248269._2
1192+ let $t04827248380 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1193+ let refreshKLpActions = $t04827248380._1
1194+ let updatedKLp = $t04827248380._2
11801195 let kLp = value(getString(keyKLp))
11811196 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11821197 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12011216
12021217 @Callable(i)
12031218 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1204- let $t04841148568 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1205- let emitAmountEstimated = $t04841148568._1
1206- let commonState = $t04841148568._2
1207- let feeAmount = $t04841148568._3
1208- let bonus = $t04841148568._4
1209- let paymentInAmountAsset = $t04841148568._5
1219+ let $t04873548892 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1220+ let emitAmountEstimated = $t04873548892._1
1221+ let commonState = $t04873548892._2
1222+ let feeAmount = $t04873548892._3
1223+ let bonus = $t04873548892._4
1224+ let paymentInAmountAsset = $t04873548892._5
12101225 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12111226 }
12121227
12431258 then {
12441259 let userAddress = i.caller
12451260 let txId = i.transactionId
1246- let $t04945349606 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1247- if (($t04945349606 == $t04945349606))
1261+ let $t04977749930 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1262+ if (($t04977749930 == $t04977749930))
12481263 then {
1249- let outInAmountAsset = $t04945349606._5
1250- let bonus = $t04945349606._4
1251- let feeAmount = $t04945349606._3
1252- let commonState = $t04945349606._2
1253- let amountEstimated = $t04945349606._1
1264+ let outInAmountAsset = $t04977749930._5
1265+ let bonus = $t04977749930._4
1266+ let feeAmount = $t04977749930._3
1267+ let commonState = $t04977749930._2
1268+ let amountEstimated = $t04977749930._1
12541269 let amount = if (if ((minOutAmount > 0))
12551270 then (minOutAmount > amountEstimated)
12561271 else false)
12641279 let sendFee = if ((feeAmount > 0))
12651280 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
12661281 else nil
1267- let $t05027050517 = {
1282+ let $t05059450841 = {
12681283 let feeAmountForCalc = if ((this == feeCollectorAddress))
12691284 then 0
12701285 else feeAmount
12721287 then $Tuple2(-((amount + feeAmountForCalc)), 0)
12731288 else $Tuple2(0, -((amount + feeAmountForCalc)))
12741289 }
1275- let amountAssetBalanceDelta = $t05027050517._1
1276- let priceAssetBalanceDelta = $t05027050517._2
1277- let $t05052050628 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1278- let refreshKLpActions = $t05052050628._1
1279- let updatedKLp = $t05052050628._2
1290+ let amountAssetBalanceDelta = $t05059450841._1
1291+ let priceAssetBalanceDelta = $t05059450841._2
1292+ let $t05084450952 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1293+ let refreshKLpActions = $t05084450952._1
1294+ let updatedKLp = $t05084450952._2
12801295 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12811296 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12821297 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
12951310
12961311 @Callable(i)
12971312 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1298- let $t05090651062 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1299- let amountEstimated = $t05090651062._1
1300- let commonState = $t05090651062._2
1301- let feeAmount = $t05090651062._3
1302- let bonus = $t05090651062._4
1303- let outInAmountAsset = $t05090651062._5
1313+ let $t05123051386 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1314+ let amountEstimated = $t05123051386._1
1315+ let commonState = $t05123051386._2
1316+ let feeAmount = $t05123051386._3
1317+ let bonus = $t05123051386._4
1318+ let outInAmountAsset = $t05123051386._5
13041319 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13051320 }
13061321
13371352 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13381353 if ((unstakeInv == unstakeInv))
13391354 then {
1340- let $t05196752118 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1341- if (($t05196752118 == $t05196752118))
1355+ let $t05229152442 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1356+ if (($t05229152442 == $t05229152442))
13421357 then {
1343- let outInAmountAsset = $t05196752118._5
1344- let bonus = $t05196752118._4
1345- let feeAmount = $t05196752118._3
1346- let commonState = $t05196752118._2
1347- let amountEstimated = $t05196752118._1
1358+ let outInAmountAsset = $t05229152442._5
1359+ let bonus = $t05229152442._4
1360+ let feeAmount = $t05229152442._3
1361+ let commonState = $t05229152442._2
1362+ let amountEstimated = $t05229152442._1
13481363 let amount = if (if ((minOutAmount > 0))
13491364 then (minOutAmount > amountEstimated)
13501365 else false)
13581373 let sendFee = if ((feeAmount > 0))
13591374 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13601375 else nil
1361- let $t05277753024 = {
1376+ let $t05310153348 = {
13621377 let feeAmountForCalc = if ((this == feeCollectorAddress))
13631378 then 0
13641379 else feeAmount
13661381 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13671382 else $Tuple2(0, -((amount + feeAmountForCalc)))
13681383 }
1369- let amountAssetBalanceDelta = $t05277753024._1
1370- let priceAssetBalanceDelta = $t05277753024._2
1371- let $t05302753135 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1372- let refreshKLpActions = $t05302753135._1
1373- let updatedKLp = $t05302753135._2
1384+ let amountAssetBalanceDelta = $t05310153348._1
1385+ let priceAssetBalanceDelta = $t05310153348._2
1386+ let $t05335153459 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1387+ let refreshKLpActions = $t05335153459._1
1388+ let updatedKLp = $t05335153459._2
13741389 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13751390 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13761391 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14041419 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14051420 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14061421 then {
1407- let $t05423054311 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1408- let refreshKLpActions = $t05423054311._1
1409- let updatedKLp = $t05423054311._2
1422+ let $t05455454635 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1423+ let refreshKLpActions = $t05455454635._1
1424+ let updatedKLp = $t05455454635._2
14101425 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14111426 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14121427 then ((withdrawState ++ state) ++ refreshKLpActions)
14391454 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14401455 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14411456 then {
1442- let $t05540655487 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1443- let refreshKLpActions = $t05540655487._1
1444- let updatedKLp = $t05540655487._2
1457+ let $t05573055811 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1458+ let refreshKLpActions = $t05573055811._1
1459+ let updatedKLp = $t05573055811._2
14451460 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14461461 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14471462 then ((withdrawState ++ state) ++ refreshKLpActions)
14861501 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
14871502 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14881503 then {
1489- let $t05675956840 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1490- let refreshKLpActions = $t05675956840._1
1491- let updatedKLp = $t05675956840._2
1504+ let $t05708357164 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1505+ let refreshKLpActions = $t05708357164._1
1506+ let updatedKLp = $t05708357164._2
14921507 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14931508 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14941509 then ((withdrawState ++ state) ++ refreshKLpActions)
15401555 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15411556 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15421557 then {
1543- let $t05828158362 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1544- let refreshKLpActions = $t05828158362._1
1545- let updatedKLp = $t05828158362._2
1558+ let $t05860558686 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1559+ let refreshKLpActions = $t05860558686._1
1560+ let updatedKLp = $t05860558686._2
15461561 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15471562 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15481563 then ((withdrawState ++ state) ++ refreshKLpActions)
15771592 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
15781593 then {
15791594 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1580- let $t05956659630 = refreshKLpInternal(0, 0, 0)
1581- let kLpUpdateActions = $t05956659630._1
1582- let updatedKLp = $t05956659630._2
1595+ let $t05989059954 = refreshKLpInternal(0, 0, 0)
1596+ let kLpUpdateActions = $t05989059954._1
1597+ let updatedKLp = $t05989059954._2
15831598 let actions = if ((kLp != updatedKLp))
15841599 then kLpUpdateActions
15851600 else throwErr("nothing to refresh")
17541769 match tx {
17551770 case order: Order =>
17561771 let matcherPub = getMatcherPubOrFail()
1757- let $t06829268409 = if (skipOrderValidation())
1772+ let $t06861668733 = if (skipOrderValidation())
17581773 then $Tuple2(true, "")
17591774 else validateMatcherOrderAllowed(order)
1760- let orderValid = $t06829268409._1
1761- let orderValidInfo = $t06829268409._2
1775+ let orderValid = $t06861668733._1
1776+ let orderValidInfo = $t06861668733._2
17621777 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17631778 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17641779 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 keyManagerPublicKey () = "%s__managerPublicKey"
9494
9595
9696 func keyManagerVaultAddress () = "%s__managerVaultAddress"
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 keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
172172
173173
174174 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
175175
176176
177177 func addressFromStringOrThis (addressString) = match addressFromString(addressString) {
178178 case a: Address =>
179179 a
180180 case _ =>
181181 this
182182 }
183183
184184
185185 func getManagerVaultAddressOrThis () = {
186186 let factoryAddress = match getString(fc()) {
187187 case fca: String =>
188188 addressFromStringOrThis(fca)
189189 case _ =>
190190 this
191191 }
192192 match getString(factoryAddress, keyManagerVaultAddress()) {
193193 case s: String =>
194194 addressFromStringOrThis(s)
195195 case _ =>
196196 this
197197 }
198198 }
199199
200200
201201 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
202202
203203
204204 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
205205
206206
207207 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
208208
209209
210210 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
211211
212212
213213 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
214214
215215 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
216216
217217 let inFee = {
218218 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
219219 if ($isInstanceOf(@, "Int"))
220220 then @
221221 else throw(($getType(@) + " couldn't be cast to Int"))
222222 }
223223
224224 let outFee = {
225225 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
226226 if ($isInstanceOf(@, "Int"))
227227 then @
228228 else throw(($getType(@) + " couldn't be cast to Int"))
229229 }
230230
231231 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
232232
233233
234234 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
235235
236236
237237 func getPoolConfig () = {
238238 let amtAsset = getStringOrFail(this, aa())
239239 let priceAsset = getStringOrFail(this, pa())
240240 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
241241 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
242242 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
243243 }
244244
245245
246246 func parseAssetId (input) = if ((input == wavesString))
247247 then unit
248248 else fromBase58String(input)
249249
250250
251251 func assetIdToString (input) = if ((input == unit))
252252 then wavesString
253253 else toBase58String(value(input))
254254
255255
256256 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]))
257257
258258
259259 let poolConfigParsed = parsePoolConfig(getPoolConfig())
260260
261261 let $t095299695 = poolConfigParsed
262262
263263 let cfgPoolAddress = $t095299695._1
264264
265265 let cfgPoolStatus = $t095299695._2
266266
267267 let cfgLpAssetId = $t095299695._3
268268
269269 let cfgAmountAssetId = $t095299695._4
270270
271271 let cfgPriceAssetId = $t095299695._5
272272
273273 let cfgAmountAssetDecimals = $t095299695._6
274274
275275 let cfgPriceAssetDecimals = $t095299695._7
276276
277277 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
278278
279279
280280 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
281281
282282 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
283283
284284 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)
285285
286286
287287 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)
288288
289289
290290 func getAccBalance (assetId) = {
291291 let balanceOnPool = if ((assetId == "WAVES"))
292292 then wavesBalance(this).available
293293 else assetBalance(this, fromBase58String(assetId))
294294 let totalBalance = ((balanceOnPool + getAdditionalBalanceOrZero(assetId)) - getStakingAssetBalanceOrZero(assetId))
295295 max([0, totalBalance])
296296 }
297297
298298
299299 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
300300
301301
302302 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
303303
304304
305305 func getRate (proxy) = {
306306 let inv = invoke(proxy, "getRate", nil, nil)
307307 if ((inv == inv))
308308 then match inv {
309309 case r: Int =>
310310 r
311311 case _ =>
312312 throwErr("proxy.getRate() unexpected value")
313313 }
314314 else throw("Strict value is not equal to itself.")
315315 }
316316
317317
318318 func deposit (assetId,amount,stakingAssetId,proxy) = {
319319 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
320320 if ((currentAdditionalBalance == currentAdditionalBalance))
321321 then {
322322 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
323323 if ((currentStakingAssetBalance == currentStakingAssetBalance))
324324 then {
325325 let asset = parseAssetId(assetId)
326326 if ((amount > 0))
327327 then {
328328 let depositInvoke = invoke(proxy, "deposit", nil, [AttachedPayment(asset, amount)])
329329 if ((depositInvoke == depositInvoke))
330330 then match depositInvoke {
331331 case receivedStakingAsset: Int =>
332332 let newAdditionalBalance = (currentAdditionalBalance + amount)
333333 let newStakingAssetBalance = (currentStakingAssetBalance + receivedStakingAsset)
334334 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance)]
335335 case _ =>
336336 nil
337337 }
338338 else throw("Strict value is not equal to itself.")
339339 }
340340 else nil
341341 }
342342 else throw("Strict value is not equal to itself.")
343343 }
344344 else throw("Strict value is not equal to itself.")
345345 }
346346
347347
348348 func withdraw (assetId,amount,stakingAssetId,proxy,proxyRateMul,profitAddress) = {
349349 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
350350 if ((currentAdditionalBalance == currentAdditionalBalance))
351351 then {
352352 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
353353 if ((currentStakingAssetBalance == currentStakingAssetBalance))
354354 then {
355355 let currentProxyRate = getRate(proxy)
356356 if ((currentProxyRate == currentProxyRate))
357357 then {
358358 let oldRate = fraction(proxyRateMul, currentAdditionalBalance, currentStakingAssetBalance)
359359 let stakingAsset = parseAssetId(stakingAssetId)
360360 let oldSendStakingAmount = fraction(proxyRateMul, amount, oldRate)
361361 let sendStakingAssetAmount = fraction(proxyRateMul, amount, currentProxyRate)
362362 let profitAmount = max([0, (oldSendStakingAmount - sendStakingAssetAmount)])
363363 if ((sendStakingAssetAmount > 0))
364364 then {
365365 let withdrawInvoke = invoke(proxy, "withdraw", nil, [AttachedPayment(stakingAsset, sendStakingAssetAmount)])
366366 if ((withdrawInvoke == withdrawInvoke))
367367 then match withdrawInvoke {
368368 case receivedAssets: Int =>
369369 let newAdditionalBalance = (currentAdditionalBalance - receivedAssets)
370370 let newStakingAssetBalance = ((currentStakingAssetBalance - sendStakingAssetAmount) - profitAmount)
371371 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance), ScriptTransfer(profitAddress, profitAmount, parseAssetId(stakingAssetId))]
372372 case _ =>
373373 nil
374374 }
375375 else throw("Strict value is not equal to itself.")
376376 }
377377 else nil
378378 }
379379 else throw("Strict value is not equal to itself.")
380380 }
381381 else throw("Strict value is not equal to itself.")
382382 }
383383 else throw("Strict value is not equal to itself.")
384384 }
385385
386386
387387 func getLeaseProxyConfig (assetId) = match invoke(factoryContract, "getPoolLeaseConfigREADONLY", [toString(this), assetId], nil) {
388388 case a: (Boolean, Int, Int, String, String, Int, String) =>
389389 a
390390 case _ =>
391391 throwErr((("[" + assetId) + "] getLeaseProxyConfig() error"))
392392 }
393393
394394
395395 func rebalanceInternal (targetRatio,assetId,stakingAssetId,minBalance,proxy,proxyRateMul,profitAddress) = {
396396 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
397397 if ((currentAdditionalBalance == currentAdditionalBalance))
398398 then {
399399 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
400400 if ((currentStakingAssetBalance == currentStakingAssetBalance))
401401 then {
402402 let leasableTotalBalance = max([0, (getAccBalance(assetId) - minBalance)])
403403 let targetAdditionalBalance = fraction(targetRatio, leasableTotalBalance, 100)
404404 let diff = (currentAdditionalBalance - targetAdditionalBalance)
405405 if ((diff == 0))
406406 then nil
407407 else if ((0 > diff))
408408 then {
409409 let sendAssetAmount = -(diff)
410410 deposit(assetId, sendAssetAmount, stakingAssetId, proxy)
411411 }
412412 else {
413413 let getAssetAmount = diff
414414 withdraw(assetId, getAssetAmount, stakingAssetId, proxy, proxyRateMul, profitAddress)
415415 }
416416 }
417417 else throw("Strict value is not equal to itself.")
418418 }
419419 else throw("Strict value is not equal to itself.")
420420 }
421421
422422
423423 func rebalanceAsset (assetId) = {
424424 let $t01593116067 = getLeaseProxyConfig(assetId)
425425 let isLeasable = $t01593116067._1
426426 let leasedRatio = $t01593116067._2
427427 let minBalance = $t01593116067._3
428428 let proxyAddress = $t01593116067._4
429429 let proxyAssetId = $t01593116067._5
430430 let proxyRateMul = $t01593116067._6
431431 let stakingProfitAddress = $t01593116067._7
432432 if (isLeasable)
433433 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
434434 else nil
435435 }
436436
437437
438438 func withdrawAndRebalanceAsset (assetId,getAmount) = {
439439 let $t01646616602 = getLeaseProxyConfig(assetId)
440440 let isLeasable = $t01646616602._1
441441 let leasedRatio = $t01646616602._2
442442 let minBalance = $t01646616602._3
443443 let proxyAddress = $t01646616602._4
444444 let proxyAssetId = $t01646616602._5
445445 let proxyRateMul = $t01646616602._6
446446 let stakingProfitAddress = $t01646616602._7
447447 if (isLeasable)
448448 then {
449449 let newTotalLeasableBalance = max([0, ((getAccBalance(assetId) - getAmount) - minBalance)])
450450 if ((newTotalLeasableBalance == newTotalLeasableBalance))
451451 then {
452452 let newAdditionalBalance = fraction(leasedRatio, newTotalLeasableBalance, 100)
453453 if ((newAdditionalBalance == newAdditionalBalance))
454454 then {
455455 let withdrawAmount = (getAdditionalBalanceOrZero(assetId) - newAdditionalBalance)
456456 if ((withdrawAmount == withdrawAmount))
457457 then if ((0 > withdrawAmount))
458458 then deposit(assetId, -(withdrawAmount), proxyAssetId, addressFromStringValue(proxyAddress))
459459 else withdraw(assetId, withdrawAmount, proxyAssetId, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
460460 else throw("Strict value is not equal to itself.")
461461 }
462462 else throw("Strict value is not equal to itself.")
463463 }
464464 else throw("Strict value is not equal to itself.")
465465 }
466466 else nil
467467 }
468468
469469
470470 func withdrawAndRebalanceAll (amountAssetOutAmount,priceAssetOutAmount) = {
471471 let AmAmtWithdrawState = withdrawAndRebalanceAsset(getStringOrFail(this, aa()), amountAssetOutAmount)
472472 let PrAmtWithdrawState = withdrawAndRebalanceAsset(getStringOrFail(this, pa()), priceAssetOutAmount)
473473 (AmAmtWithdrawState ++ PrAmtWithdrawState)
474474 }
475475
476476
477477 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
478478 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
479479 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
480480 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
481481 }
482482
483483
484484 func calcPrices (amAmt,prAmt,lpAmt) = {
485485 let cfg = getPoolConfig()
486486 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
487487 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
488488 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
489489 let amAmtX18 = toX18(amAmt, amtAssetDcm)
490490 let prAmtX18 = toX18(prAmt, priceAssetDcm)
491491 let lpAmtX18 = toX18(lpAmt, scale8)
492492 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
493493 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
494494 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
495495 }
496496
497497
498498 func calculatePrices (amAmt,prAmt,lpAmt) = {
499499 let prices = calcPrices(amAmt, prAmt, lpAmt)
500500 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
501501 }
502502
503503
504504 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
505505 let cfg = getPoolConfig()
506506 let lpAssetId = cfg[idxPoolLPAssetId]
507507 let amAssetId = cfg[idxAmtAssetId]
508508 let prAssetId = cfg[idxPriceAssetId]
509509 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
510510 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
511511 let poolStatus = cfg[idxPoolStatus]
512512 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
513513 if ((lpAssetId != pmtAssetId))
514514 then throw("Invalid asset passed.")
515515 else {
516516 let amBalance = getAccBalance(amAssetId)
517517 let amBalanceX18 = toX18(amBalance, amAssetDcm)
518518 let prBalance = getAccBalance(prAssetId)
519519 let prBalanceX18 = toX18(prBalance, prAssetDcm)
520520 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
521521 let curPrice = fromX18(curPriceX18, scale8)
522522 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
523523 let lpEmissionX18 = toX18(lpEmission, scale8)
524524 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
525525 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
526526 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
527527 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
528528 let state = if ((txId58 == ""))
529529 then nil
530530 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
531531 then unit
532532 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
533533 then unit
534534 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)]
535535 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
536536 }
537537 }
538538
539539
540540 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
541541 let cfg = getPoolConfig()
542542 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
543543 let amAssetIdStr = cfg[idxAmtAssetId]
544544 let prAssetIdStr = cfg[idxPriceAssetId]
545545 let iAmtAssetId = cfg[idxIAmtAssetId]
546546 let iPriceAssetId = cfg[idxIPriceAssetId]
547547 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
548548 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
549549 let poolStatus = cfg[idxPoolStatus]
550550 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
551551 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
552552 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
553553 if (if ((amAssetIdStr != inAmAssetIdStr))
554554 then true
555555 else (prAssetIdStr != inPrAssetIdStr))
556556 then throw("Invalid amt or price asset passed.")
557557 else {
558558 let amBalance = if (isEvaluate)
559559 then getAccBalance(amAssetIdStr)
560560 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
561561 let prBalance = if (isEvaluate)
562562 then getAccBalance(prAssetIdStr)
563563 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
564564 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
565565 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
566566 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
567567 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
568568 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
569569 let res = if ((lpEmission == 0))
570570 then {
571571 let curPriceX18 = zeroBigInt
572572 let slippageX18 = zeroBigInt
573573 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
574574 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
575575 }
576576 else {
577577 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
578578 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
579579 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
580580 if (if ((curPriceX18 != zeroBigInt))
581581 then (slippageX18 > slippageToleranceX18)
582582 else false)
583583 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
584584 else {
585585 let lpEmissionX18 = toX18(lpEmission, scale8)
586586 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
587587 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
588588 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
589589 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
590590 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
591591 let expAmtAssetAmtX18 = expectedAmts._1
592592 let expPriceAssetAmtX18 = expectedAmts._2
593593 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
594594 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
595595 }
596596 }
597597 let calcLpAmt = res._1
598598 let calcAmAssetPmt = res._2
599599 let calcPrAssetPmt = res._3
600600 let curPrice = fromX18(res._4, scale8)
601601 let slippageCalc = fromX18(res._5, scale8)
602602 if ((0 >= calcLpAmt))
603603 then throw("Invalid calculations. LP calculated is less than zero.")
604604 else {
605605 let emitLpAmt = if (!(emitLp))
606606 then 0
607607 else calcLpAmt
608608 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
609609 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
610610 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))]
611611 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
612612 }
613613 }
614614 }
615615
616616
617617 func calcKLp (amountBalance,priceBalance,lpEmission) = {
618618 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
619619 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
620620 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
621621 if ((lpEmission == big0))
622622 then big0
623623 else updatedKLp
624624 }
625625
626626
627627 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
628628 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
629629 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
630630 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
631631 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
632632 currentKLp
633633 }
634634
635635
636636 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
637637 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
638638 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
639639 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
640640 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
641641 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
642642 $Tuple2(actions, updatedKLp)
643643 }
644644
645645
646646 func skipOrderValidation () = valueOrElse(getBoolean(factoryContract, keySkipOrderValidation(toString(this))), false)
647647
648648
649649 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
650650 then true
651651 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
652652
653653
654654 func validateMatcherOrderAllowed (order) = {
655655 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
656656 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
657657 let amountAssetAmount = order.amount
658658 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
659659 let $t02899129203 = if ((order.orderType == Buy))
660660 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
661661 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
662662 let amountAssetBalanceDelta = $t02899129203._1
663663 let priceAssetBalanceDelta = $t02899129203._2
664664 if (if (if (isGlobalShutdown())
665665 then true
666666 else (cfgPoolStatus == PoolMatcherDisabled))
667667 then true
668668 else (cfgPoolStatus == PoolShutdown))
669669 then throw("Exchange operations disabled")
670670 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
671671 then true
672672 else (order.assetPair.priceAsset != cfgPriceAssetId))
673673 then throw("Wrong order assets.")
674674 else {
675675 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
676676 let $t02964329743 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
677677 let unusedActions = $t02964329743._1
678678 let kLpNew = $t02964329743._2
679679 let isOrderValid = (kLpNew >= kLp)
680680 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
681681 $Tuple2(isOrderValid, info)
682682 }
683683 }
684684
685685
686686 func commonGet (i) = if ((size(i.payments) != 1))
687687 then throw("exactly 1 payment is expected")
688688 else {
689689 let pmt = value(i.payments[0])
690690 let pmtAssetId = value(pmt.assetId)
691691 let pmtAmt = pmt.amount
692692 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
693693 let outAmAmt = res._1
694694 let outPrAmt = res._2
695695 let poolStatus = parseIntValue(res._9)
696696 let state = res._10
697697 if (if (isGlobalShutdown())
698698 then true
699699 else (poolStatus == PoolShutdown))
700700 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
701701 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
702702 }
703703
704704
705705 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
706706 then throw("exactly 2 payments are expected")
707707 else {
708708 let amAssetPmt = value(i.payments[0])
709709 let prAssetPmt = value(i.payments[1])
710710 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
711711 let poolStatus = parseIntValue(estPut._8)
712712 if (if (if (isGlobalShutdown())
713713 then true
714714 else (poolStatus == PoolPutDisabled))
715715 then true
716716 else (poolStatus == PoolShutdown))
717717 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
718718 else estPut
719719 }
720720
721721
722722 func emit (amount) = {
723723 let emitInv = invoke(factoryContract, "emit", [amount], nil)
724724 if ((emitInv == emitInv))
725725 then {
726726 let emitInvLegacy = match emitInv {
727727 case legacyFactoryContract: Address =>
728728 invoke(legacyFactoryContract, "emit", [amount], nil)
729729 case _ =>
730730 unit
731731 }
732732 if ((emitInvLegacy == emitInvLegacy))
733733 then amount
734734 else throw("Strict value is not equal to itself.")
735735 }
736736 else throw("Strict value is not equal to itself.")
737737 }
738738
739739
740740 func takeFee (amount,fee) = {
741741 let feeAmount = if ((fee == 0))
742742 then 0
743743 else fraction(amount, fee, scale8)
744744 $Tuple2((amount - feeAmount), feeAmount)
745745 }
746746
747747
748748 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
749749 let isEval = (txId == unit)
750750 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
751751 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
752752 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
753753 then true
754754 else if ((paymentAssetId == cfgPriceAssetId))
755755 then false
756756 else throwErr("invalid asset")
757757 let $t03285633149 = if (isEval)
758758 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
759759 else if (paymentInAmountAsset)
760760 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
761761 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
762762 let amountBalanceOld = $t03285633149._1
763763 let priceBalanceOld = $t03285633149._2
764764 let $t03315333302 = if (paymentInAmountAsset)
765765 then $Tuple2(paymentAmountRaw, 0)
766766 else $Tuple2(0, paymentAmountRaw)
767767 let amountAssetAmountRaw = $t03315333302._1
768768 let priceAssetAmountRaw = $t03315333302._2
769769 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
770770 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
771771 let $t03343433498 = takeFee(paymentAmountRaw, inFee)
772772 let paymentAmount = $t03343433498._1
773773 let feeAmount = $t03343433498._2
774774 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
775775 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
776776 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
777777 let priceNew = fromX18(priceNewX18, scale8)
778778 let paymentBalance = if (paymentInAmountAsset)
779779 then amountBalanceOld
780780 else priceBalanceOld
781781 let paymentBalanceBigInt = toBigInt(paymentBalance)
782782 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
783783 let chechSupply = if ((supplyBigInt > big0))
784784 then true
785785 else throwErr("initial deposit requires all coins")
786786 if ((chechSupply == chechSupply))
787787 then {
788788 let depositBigInt = toBigInt(paymentAmount)
789789 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
790790 let commonState = if (isEval)
791791 then nil
792792 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))]
793793 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
794794 let priceOld = fromX18(priceOldX18, scale8)
795795 let loss = {
796796 let $t03517935346 = if (paymentInAmountAsset)
797797 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
798798 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
799799 let amount = $t03517935346._1
800800 let balance = $t03517935346._2
801801 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
802802 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
803803 }
804804 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
805805 }
806806 else throw("Strict value is not equal to itself.")
807807 }
808808
809809
810810 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
811811 let isEval = (txId == unit)
812812 let cfg = getPoolConfig()
813813 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
814814 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
815815 let checks = [if ((paymentAssetId == cfgLpAssetId))
816816 then true
817817 else throwErr("invalid lp asset")]
818818 if ((checks == checks))
819819 then {
820820 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
821821 then true
822822 else if ((outAssetId == cfgPriceAssetId))
823823 then false
824824 else throwErr("invalid asset")
825825 let balanceBigInt = if (outInAmountAsset)
826826 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
827827 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
828828 let outInAmountAssetDecimals = if (outInAmountAsset)
829829 then amtAssetDcm
830830 else priceAssetDcm
831831 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
832832 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
833833 let outBalance = if (outInAmountAsset)
834834 then amBalanceOld
835835 else prBalanceOld
836836 let outBalanceBigInt = toBigInt(outBalance)
837837 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
838838 let redeemedBigInt = toBigInt(paymentAmount)
839839 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
840840 let $t03742437480 = takeFee(amountRaw, outFee)
841841 let totalAmount = $t03742437480._1
842842 let feeAmount = $t03742437480._2
843843 let $t03748437710 = if (outInAmountAsset)
844844 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
845845 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
846846 let outAmAmount = $t03748437710._1
847847 let outPrAmount = $t03748437710._2
848848 let amBalanceNew = $t03748437710._3
849849 let prBalanceNew = $t03748437710._4
850850 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
851851 let priceNew = fromX18(priceNewX18, scale8)
852852 let commonState = if (isEval)
853853 then nil
854854 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)]
855855 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
856856 let priceOld = fromX18(priceOldX18, scale8)
857857 let loss = {
858858 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
859859 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
860860 }
861861 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
862862 }
863863 else throw("Strict value is not equal to itself.")
864864 }
865865
866866
867867 func managerPublicKeyOrUnit () = {
868868 let managerVaultAddress = getManagerVaultAddressOrThis()
869869 match getString(managerVaultAddress, keyManagerPublicKey()) {
870870 case s: String =>
871871 fromBase58String(s)
872872 case _: Unit =>
873873 unit
874874 case _ =>
875875 throw("Match error")
876876 }
877877 }
878878
879879
880880 func isManager (i) = match managerPublicKeyOrUnit() {
881881 case pk: ByteVector =>
882882 (i.callerPublicKey == pk)
883883 case _: Unit =>
884884 (i.caller == this)
885885 case _ =>
886886 throw("Match error")
887887 }
888888
889889
890890 func mustManager (i) = {
891891 let pd = throw("Permission denied")
892892 match managerPublicKeyOrUnit() {
893893 case pk: ByteVector =>
894894 if ((i.callerPublicKey == pk))
895895 then true
896896 else pd
897897 case _: Unit =>
898898 if ((i.caller == this))
899899 then true
900900 else pd
901901 case _ =>
902902 throw("Match error")
903903 }
904904 }
905905
906906
907907 @Callable(i)
908908 func rebalance () = (rebalanceAsset(getStringOrFail(this, aa())) ++ rebalanceAsset(getStringOrFail(this, pa())))
909909
910910
911911
912912 @Callable(i)
913913 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
914914 let $t03956839873 = if ((isReverse == false))
915915 then {
916916 let assetOut = getStringOrFail(this, pa())
917917 let assetIn = getStringOrFail(this, aa())
918918 $Tuple2(assetOut, assetIn)
919919 }
920920 else {
921921 let assetOut = getStringOrFail(this, aa())
922922 let assetIn = getStringOrFail(this, pa())
923923 $Tuple2(assetOut, assetIn)
924924 }
925925 let assetOut = $t03956839873._1
926926 let assetIn = $t03956839873._2
927927 let poolAssetInBalance = getAccBalance(assetIn)
928928 let poolAssetOutBalance = getAccBalance(assetOut)
929929 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
930930 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
931931 let newK = (((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
932932 let checkK = if ((newK >= oldK))
933933 then true
934934 else throw("new K is fewer error")
935935 if ((checkK == checkK))
936936 then $Tuple2(nil, amountOut)
937937 else throw("Strict value is not equal to itself.")
938938 }
939939
940940
941941
942942 @Callable(i)
943943 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
944944 let swapContact = {
945945 let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
946946 if ($isInstanceOf(@, "String"))
947947 then @
948948 else throw(($getType(@) + " couldn't be cast to String"))
949949 }
950- let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
950+ let isPoolSwapDisabled = {
951+ let @ = invoke(factoryContract, "isPoolSwapDisabledREADONLY", [toString(this)], nil)
952+ if ($isInstanceOf(@, "Boolean"))
953+ then @
954+ else throw(($getType(@) + " couldn't be cast to Boolean"))
955+ }
956+ let isSwapDisabled = if (if (isGlobalShutdown())
957+ then true
958+ else (cfgPoolStatus == PoolShutdown))
959+ then true
960+ else isPoolSwapDisabled
961+ let checks = [if (if (!(isSwapDisabled))
962+ then true
963+ else isManager(i))
964+ then true
965+ else throwErr("swap operation is blocked by admin"), if ((value(i.payments[0]).amount >= cleanAmountIn))
951966 then true
952967 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
953968 then true
954969 else throwErr("Permission denied")]
955970 if ((checks == checks))
956971 then {
957972 let pmt = value(i.payments[0])
958973 let assetIn = assetIdToString(pmt.assetId)
959974 let assetOut = if ((isReverse == false))
960975 then getStringOrFail(this, pa())
961976 else getStringOrFail(this, aa())
962977 let poolAssetInBalance = ((getAccBalance(assetIn) - value(i.payments[0]).amount) - feePoolAmount)
963978 let poolAssetOutBalance = getAccBalance(assetOut)
964979 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
965980 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
966981 let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
967982 let checkK = if ((newK >= oldK))
968983 then true
969984 else throw("new K is fewer error")
970985 if ((checkK == checkK))
971986 then {
972987 let checkMin = if ((amountOut >= amountOutMin))
973988 then true
974989 else throw("Exchange result is fewer coins than expected")
975990 if ((checkMin == checkMin))
976991 then {
977992 let amountAssetBalanceDelta = if (isReverse)
978993 then -(amountOut)
979994 else feePoolAmount
980995 let priceAssetBalanceDelta = if (isReverse)
981996 then feePoolAmount
982997 else -(amountOut)
983998 let refreshKLpActions = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)._1
984999 if ((refreshKLpActions == refreshKLpActions))
9851000 then {
9861001 let rebalanceState = rebalanceAsset(assetIn)
9871002 if ((rebalanceState == rebalanceState))
9881003 then {
9891004 let withdrawState = withdrawAndRebalanceAsset(assetOut, amountOut)
9901005 if ((withdrawState == withdrawState))
9911006 then $Tuple2(((withdrawState ++ rebalanceState) ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
9921007 else throw("Strict value is not equal to itself.")
9931008 }
9941009 else throw("Strict value is not equal to itself.")
9951010 }
9961011 else throw("Strict value is not equal to itself.")
9971012 }
9981013 else throw("Strict value is not equal to itself.")
9991014 }
10001015 else throw("Strict value is not equal to itself.")
10011016 }
10021017 else throw("Strict value is not equal to itself.")
10031018 }
10041019
10051020
10061021
10071022 @Callable(i)
10081023 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
10091024 then throw("Invalid slippageTolerance passed")
10101025 else {
10111026 let estPut = commonPut(i, slippageTolerance, true)
10121027 let emitLpAmt = estPut._2
10131028 let lpAssetId = estPut._7
10141029 let state = estPut._9
10151030 let amDiff = estPut._10
10161031 let prDiff = estPut._11
10171032 let amId = estPut._12
10181033 let prId = estPut._13
10191034 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10201035 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10211036 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10221037 if ((currentKLp == currentKLp))
10231038 then {
10241039 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
10251040 if ((emitInv == emitInv))
10261041 then {
10271042 let emitInvLegacy = match emitInv {
10281043 case legacyFactoryContract: Address =>
10291044 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
10301045 case _ =>
10311046 unit
10321047 }
10331048 if ((emitInvLegacy == emitInvLegacy))
10341049 then {
10351050 let slippageAInv = if ((amDiff > 0))
10361051 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
10371052 else nil
10381053 if ((slippageAInv == slippageAInv))
10391054 then {
10401055 let slippagePInv = if ((prDiff > 0))
10411056 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
10421057 else nil
10431058 if ((slippagePInv == slippagePInv))
10441059 then {
10451060 let lpTransfer = if (shouldAutoStake)
10461061 then {
10471062 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
10481063 if ((slpStakeInv == slpStakeInv))
10491064 then nil
10501065 else throw("Strict value is not equal to itself.")
10511066 }
10521067 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1053- let $t04468345145 = refreshKLpInternal(0, 0, 0)
1054- if (($t04468345145 == $t04468345145))
1068+ let $t04500745469 = refreshKLpInternal(0, 0, 0)
1069+ if (($t04500745469 == $t04500745469))
10551070 then {
1056- let updatedKLp = $t04468345145._2
1057- let refreshKLpActions = $t04468345145._1
1071+ let updatedKLp = $t04500745469._2
1072+ let refreshKLpActions = $t04500745469._1
10581073 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10591074 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10601075 then {
10611076 let reb = invoke(this, "rebalance", nil, nil)
10621077 if ((reb == reb))
10631078 then ((state ++ lpTransfer) ++ refreshKLpActions)
10641079 else throw("Strict value is not equal to itself.")
10651080 }
10661081 else throw("Strict value is not equal to itself.")
10671082 }
10681083 else throw("Strict value is not equal to itself.")
10691084 }
10701085 else throw("Strict value is not equal to itself.")
10711086 }
10721087 else throw("Strict value is not equal to itself.")
10731088 }
10741089 else throw("Strict value is not equal to itself.")
10751090 }
10761091 else throw("Strict value is not equal to itself.")
10771092 }
10781093 else throw("Strict value is not equal to itself.")
10791094 }
10801095
10811096
10821097
10831098 @Callable(i)
10841099 func putForFree (maxSlippage) = if ((0 > maxSlippage))
10851100 then throw("Invalid value passed")
10861101 else {
10871102 let estPut = commonPut(i, maxSlippage, false)
10881103 let state = estPut._9
10891104 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10901105 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10911106 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10921107 if ((currentKLp == currentKLp))
10931108 then {
1094- let $t04575745822 = refreshKLpInternal(0, 0, 0)
1095- let refreshKLpActions = $t04575745822._1
1096- let updatedKLp = $t04575745822._2
1109+ let $t04608146146 = refreshKLpInternal(0, 0, 0)
1110+ let refreshKLpActions = $t04608146146._1
1111+ let updatedKLp = $t04608146146._2
10971112 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10981113 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10991114 then (state ++ refreshKLpActions)
11001115 else throw("Strict value is not equal to itself.")
11011116 }
11021117 else throw("Strict value is not equal to itself.")
11031118 }
11041119
11051120
11061121
11071122 @Callable(i)
11081123 func putOneTkn (minOutAmount,autoStake) = {
11091124 let isPoolOneTokenOperationsDisabled = {
11101125 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11111126 if ($isInstanceOf(@, "Boolean"))
11121127 then @
11131128 else throw(($getType(@) + " couldn't be cast to Boolean"))
11141129 }
11151130 let isPutDisabled = if (if (if (isGlobalShutdown())
11161131 then true
11171132 else (cfgPoolStatus == PoolPutDisabled))
11181133 then true
11191134 else (cfgPoolStatus == PoolShutdown))
11201135 then true
11211136 else isPoolOneTokenOperationsDisabled
11221137 let checks = [if (if (!(isPutDisabled))
11231138 then true
11241139 else isManager(i))
11251140 then true
11261141 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
11271142 then true
11281143 else throwErr("exactly 1 payment are expected")]
11291144 if ((checks == checks))
11301145 then {
11311146 let payment = i.payments[0]
11321147 let paymentAssetId = payment.assetId
11331148 let paymentAmountRaw = payment.amount
11341149 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
11351150 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
11361151 else if ((paymentAssetId == cfgPriceAssetId))
11371152 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
11381153 else throwErr("payment asset is not supported")
11391154 if ((currentKLp == currentKLp))
11401155 then {
11411156 let userAddress = i.caller
11421157 let txId = i.transactionId
1143- let $t04701047162 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1144- if (($t04701047162 == $t04701047162))
1158+ let $t04733447486 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1159+ if (($t04733447486 == $t04733447486))
11451160 then {
1146- let paymentInAmountAsset = $t04701047162._5
1147- let bonus = $t04701047162._4
1148- let feeAmount = $t04701047162._3
1149- let commonState = $t04701047162._2
1150- let emitAmountEstimated = $t04701047162._1
1161+ let paymentInAmountAsset = $t04733447486._5
1162+ let bonus = $t04733447486._4
1163+ let feeAmount = $t04733447486._3
1164+ let commonState = $t04733447486._2
1165+ let emitAmountEstimated = $t04733447486._1
11511166 let emitAmount = if (if ((minOutAmount > 0))
11521167 then (minOutAmount > emitAmountEstimated)
11531168 else false)
11541169 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
11551170 else emitAmountEstimated
11561171 let emitInv = emit(emitAmount)
11571172 if ((emitInv == emitInv))
11581173 then {
11591174 let lpTransfer = if (autoStake)
11601175 then {
11611176 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
11621177 if ((stakeInv == stakeInv))
11631178 then nil
11641179 else throw("Strict value is not equal to itself.")
11651180 }
11661181 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
11671182 let sendFee = if ((feeAmount > 0))
11681183 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11691184 else nil
1170- let $t04774847945 = if ((this == feeCollectorAddress))
1185+ let $t04807248269 = if ((this == feeCollectorAddress))
11711186 then $Tuple2(0, 0)
11721187 else if (paymentInAmountAsset)
11731188 then $Tuple2(-(feeAmount), 0)
11741189 else $Tuple2(0, -(feeAmount))
1175- let amountAssetBalanceDelta = $t04774847945._1
1176- let priceAssetBalanceDelta = $t04774847945._2
1177- let $t04794848056 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1178- let refreshKLpActions = $t04794848056._1
1179- let updatedKLp = $t04794848056._2
1190+ let amountAssetBalanceDelta = $t04807248269._1
1191+ let priceAssetBalanceDelta = $t04807248269._2
1192+ let $t04827248380 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1193+ let refreshKLpActions = $t04827248380._1
1194+ let updatedKLp = $t04827248380._2
11801195 let kLp = value(getString(keyKLp))
11811196 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11821197 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11831198 then {
11841199 let reb = invoke(this, "rebalance", nil, nil)
11851200 if ((reb == reb))
11861201 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
11871202 else throw("Strict value is not equal to itself.")
11881203 }
11891204 else throw("Strict value is not equal to itself.")
11901205 }
11911206 else throw("Strict value is not equal to itself.")
11921207 }
11931208 else throw("Strict value is not equal to itself.")
11941209 }
11951210 else throw("Strict value is not equal to itself.")
11961211 }
11971212 else throw("Strict value is not equal to itself.")
11981213 }
11991214
12001215
12011216
12021217 @Callable(i)
12031218 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1204- let $t04841148568 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1205- let emitAmountEstimated = $t04841148568._1
1206- let commonState = $t04841148568._2
1207- let feeAmount = $t04841148568._3
1208- let bonus = $t04841148568._4
1209- let paymentInAmountAsset = $t04841148568._5
1219+ let $t04873548892 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1220+ let emitAmountEstimated = $t04873548892._1
1221+ let commonState = $t04873548892._2
1222+ let feeAmount = $t04873548892._3
1223+ let bonus = $t04873548892._4
1224+ let paymentInAmountAsset = $t04873548892._5
12101225 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12111226 }
12121227
12131228
12141229
12151230 @Callable(i)
12161231 func getOneTkn (outAssetIdStr,minOutAmount) = {
12171232 let isPoolOneTokenOperationsDisabled = {
12181233 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12191234 if ($isInstanceOf(@, "Boolean"))
12201235 then @
12211236 else throw(($getType(@) + " couldn't be cast to Boolean"))
12221237 }
12231238 let isGetDisabled = if (if (isGlobalShutdown())
12241239 then true
12251240 else (cfgPoolStatus == PoolShutdown))
12261241 then true
12271242 else isPoolOneTokenOperationsDisabled
12281243 let checks = [if (if (!(isGetDisabled))
12291244 then true
12301245 else isManager(i))
12311246 then true
12321247 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
12331248 then true
12341249 else throwErr("exactly 1 payment are expected")]
12351250 if ((checks == checks))
12361251 then {
12371252 let outAssetId = parseAssetId(outAssetIdStr)
12381253 let payment = i.payments[0]
12391254 let paymentAssetId = payment.assetId
12401255 let paymentAmount = payment.amount
12411256 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12421257 if ((currentKLp == currentKLp))
12431258 then {
12441259 let userAddress = i.caller
12451260 let txId = i.transactionId
1246- let $t04945349606 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1247- if (($t04945349606 == $t04945349606))
1261+ let $t04977749930 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1262+ if (($t04977749930 == $t04977749930))
12481263 then {
1249- let outInAmountAsset = $t04945349606._5
1250- let bonus = $t04945349606._4
1251- let feeAmount = $t04945349606._3
1252- let commonState = $t04945349606._2
1253- let amountEstimated = $t04945349606._1
1264+ let outInAmountAsset = $t04977749930._5
1265+ let bonus = $t04977749930._4
1266+ let feeAmount = $t04977749930._3
1267+ let commonState = $t04977749930._2
1268+ let amountEstimated = $t04977749930._1
12541269 let amount = if (if ((minOutAmount > 0))
12551270 then (minOutAmount > amountEstimated)
12561271 else false)
12571272 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12581273 else amountEstimated
12591274 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
12601275 if ((burnInv == burnInv))
12611276 then {
12621277 let withdrawState = withdrawAndRebalanceAsset(outAssetIdStr, (amount + max([0, feeAmount])))
12631278 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
12641279 let sendFee = if ((feeAmount > 0))
12651280 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
12661281 else nil
1267- let $t05027050517 = {
1282+ let $t05059450841 = {
12681283 let feeAmountForCalc = if ((this == feeCollectorAddress))
12691284 then 0
12701285 else feeAmount
12711286 if (outInAmountAsset)
12721287 then $Tuple2(-((amount + feeAmountForCalc)), 0)
12731288 else $Tuple2(0, -((amount + feeAmountForCalc)))
12741289 }
1275- let amountAssetBalanceDelta = $t05027050517._1
1276- let priceAssetBalanceDelta = $t05027050517._2
1277- let $t05052050628 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1278- let refreshKLpActions = $t05052050628._1
1279- let updatedKLp = $t05052050628._2
1290+ let amountAssetBalanceDelta = $t05059450841._1
1291+ let priceAssetBalanceDelta = $t05059450841._2
1292+ let $t05084450952 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1293+ let refreshKLpActions = $t05084450952._1
1294+ let updatedKLp = $t05084450952._2
12801295 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12811296 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12821297 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
12831298 else throw("Strict value is not equal to itself.")
12841299 }
12851300 else throw("Strict value is not equal to itself.")
12861301 }
12871302 else throw("Strict value is not equal to itself.")
12881303 }
12891304 else throw("Strict value is not equal to itself.")
12901305 }
12911306 else throw("Strict value is not equal to itself.")
12921307 }
12931308
12941309
12951310
12961311 @Callable(i)
12971312 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1298- let $t05090651062 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1299- let amountEstimated = $t05090651062._1
1300- let commonState = $t05090651062._2
1301- let feeAmount = $t05090651062._3
1302- let bonus = $t05090651062._4
1303- let outInAmountAsset = $t05090651062._5
1313+ let $t05123051386 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1314+ let amountEstimated = $t05123051386._1
1315+ let commonState = $t05123051386._2
1316+ let feeAmount = $t05123051386._3
1317+ let bonus = $t05123051386._4
1318+ let outInAmountAsset = $t05123051386._5
13041319 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13051320 }
13061321
13071322
13081323
13091324 @Callable(i)
13101325 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
13111326 let isPoolOneTokenOperationsDisabled = {
13121327 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13131328 if ($isInstanceOf(@, "Boolean"))
13141329 then @
13151330 else throw(($getType(@) + " couldn't be cast to Boolean"))
13161331 }
13171332 let isGetDisabled = if (if (isGlobalShutdown())
13181333 then true
13191334 else (cfgPoolStatus == PoolShutdown))
13201335 then true
13211336 else isPoolOneTokenOperationsDisabled
13221337 let checks = [if (if (!(isGetDisabled))
13231338 then true
13241339 else isManager(i))
13251340 then true
13261341 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
13271342 then true
13281343 else throwErr("no payments are expected")]
13291344 if ((checks == checks))
13301345 then {
13311346 let outAssetId = parseAssetId(outAssetIdStr)
13321347 let userAddress = i.caller
13331348 let txId = i.transactionId
13341349 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
13351350 if ((currentKLp == currentKLp))
13361351 then {
13371352 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13381353 if ((unstakeInv == unstakeInv))
13391354 then {
1340- let $t05196752118 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1341- if (($t05196752118 == $t05196752118))
1355+ let $t05229152442 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1356+ if (($t05229152442 == $t05229152442))
13421357 then {
1343- let outInAmountAsset = $t05196752118._5
1344- let bonus = $t05196752118._4
1345- let feeAmount = $t05196752118._3
1346- let commonState = $t05196752118._2
1347- let amountEstimated = $t05196752118._1
1358+ let outInAmountAsset = $t05229152442._5
1359+ let bonus = $t05229152442._4
1360+ let feeAmount = $t05229152442._3
1361+ let commonState = $t05229152442._2
1362+ let amountEstimated = $t05229152442._1
13481363 let amount = if (if ((minOutAmount > 0))
13491364 then (minOutAmount > amountEstimated)
13501365 else false)
13511366 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
13521367 else amountEstimated
13531368 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13541369 if ((burnInv == burnInv))
13551370 then {
13561371 let withdrawState = withdrawAndRebalanceAsset(outAssetIdStr, (amount + max([0, feeAmount])))
13571372 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
13581373 let sendFee = if ((feeAmount > 0))
13591374 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13601375 else nil
1361- let $t05277753024 = {
1376+ let $t05310153348 = {
13621377 let feeAmountForCalc = if ((this == feeCollectorAddress))
13631378 then 0
13641379 else feeAmount
13651380 if (outInAmountAsset)
13661381 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13671382 else $Tuple2(0, -((amount + feeAmountForCalc)))
13681383 }
1369- let amountAssetBalanceDelta = $t05277753024._1
1370- let priceAssetBalanceDelta = $t05277753024._2
1371- let $t05302753135 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1372- let refreshKLpActions = $t05302753135._1
1373- let updatedKLp = $t05302753135._2
1384+ let amountAssetBalanceDelta = $t05310153348._1
1385+ let priceAssetBalanceDelta = $t05310153348._2
1386+ let $t05335153459 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1387+ let refreshKLpActions = $t05335153459._1
1388+ let updatedKLp = $t05335153459._2
13741389 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13751390 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13761391 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13771392 else throw("Strict value is not equal to itself.")
13781393 }
13791394 else throw("Strict value is not equal to itself.")
13801395 }
13811396 else throw("Strict value is not equal to itself.")
13821397 }
13831398 else throw("Strict value is not equal to itself.")
13841399 }
13851400 else throw("Strict value is not equal to itself.")
13861401 }
13871402 else throw("Strict value is not equal to itself.")
13881403 }
13891404
13901405
13911406
13921407 @Callable(i)
13931408 func get () = {
13941409 let res = commonGet(i)
13951410 let outAmAmt = res._1
13961411 let outPrAmt = res._2
13971412 let pmtAmt = res._3
13981413 let pmtAssetId = res._4
13991414 let state = res._5
14001415 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
14011416 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14021417 if ((currentKLp == currentKLp))
14031418 then {
14041419 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14051420 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14061421 then {
1407- let $t05423054311 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1408- let refreshKLpActions = $t05423054311._1
1409- let updatedKLp = $t05423054311._2
1422+ let $t05455454635 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1423+ let refreshKLpActions = $t05455454635._1
1424+ let updatedKLp = $t05455454635._2
14101425 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14111426 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14121427 then ((withdrawState ++ state) ++ refreshKLpActions)
14131428 else throw("Strict value is not equal to itself.")
14141429 }
14151430 else throw("Strict value is not equal to itself.")
14161431 }
14171432 else throw("Strict value is not equal to itself.")
14181433 }
14191434
14201435
14211436
14221437 @Callable(i)
14231438 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14241439 let res = commonGet(i)
14251440 let outAmAmt = res._1
14261441 let outPrAmt = res._2
14271442 let pmtAmt = res._3
14281443 let pmtAssetId = res._4
14291444 let state = res._5
14301445 if ((noLessThenAmtAsset > outAmAmt))
14311446 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14321447 else if ((noLessThenPriceAsset > outPrAmt))
14331448 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14341449 else {
14351450 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
14361451 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14371452 if ((currentKLp == currentKLp))
14381453 then {
14391454 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14401455 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14411456 then {
1442- let $t05540655487 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1443- let refreshKLpActions = $t05540655487._1
1444- let updatedKLp = $t05540655487._2
1457+ let $t05573055811 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1458+ let refreshKLpActions = $t05573055811._1
1459+ let updatedKLp = $t05573055811._2
14451460 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14461461 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14471462 then ((withdrawState ++ state) ++ refreshKLpActions)
14481463 else throw("Strict value is not equal to itself.")
14491464 }
14501465 else throw("Strict value is not equal to itself.")
14511466 }
14521467 else throw("Strict value is not equal to itself.")
14531468 }
14541469 }
14551470
14561471
14571472
14581473 @Callable(i)
14591474 func unstakeAndGet (amount) = {
14601475 let checkPayments = if ((size(i.payments) != 0))
14611476 then throw("No payments are expected")
14621477 else true
14631478 if ((checkPayments == checkPayments))
14641479 then {
14651480 let cfg = getPoolConfig()
14661481 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14671482 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14681483 if ((currentKLp == currentKLp))
14691484 then {
14701485 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
14711486 if ((unstakeInv == unstakeInv))
14721487 then {
14731488 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
14741489 let outAmAmt = res._1
14751490 let outPrAmt = res._2
14761491 let poolStatus = parseIntValue(res._9)
14771492 let state = res._10
14781493 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
14791494 let checkPoolStatus = if (if (isGlobalShutdown())
14801495 then true
14811496 else (poolStatus == PoolShutdown))
14821497 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
14831498 else true
14841499 if ((checkPoolStatus == checkPoolStatus))
14851500 then {
14861501 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
14871502 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14881503 then {
1489- let $t05675956840 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1490- let refreshKLpActions = $t05675956840._1
1491- let updatedKLp = $t05675956840._2
1504+ let $t05708357164 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1505+ let refreshKLpActions = $t05708357164._1
1506+ let updatedKLp = $t05708357164._2
14921507 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14931508 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14941509 then ((withdrawState ++ state) ++ refreshKLpActions)
14951510 else throw("Strict value is not equal to itself.")
14961511 }
14971512 else throw("Strict value is not equal to itself.")
14981513 }
14991514 else throw("Strict value is not equal to itself.")
15001515 }
15011516 else throw("Strict value is not equal to itself.")
15021517 }
15031518 else throw("Strict value is not equal to itself.")
15041519 }
15051520 else throw("Strict value is not equal to itself.")
15061521 }
15071522
15081523
15091524
15101525 @Callable(i)
15111526 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15121527 let isGetDisabled = if (isGlobalShutdown())
15131528 then true
15141529 else (cfgPoolStatus == PoolShutdown)
15151530 let checks = [if (!(isGetDisabled))
15161531 then true
15171532 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15181533 then true
15191534 else throw("no payments are expected")]
15201535 if ((checks == checks))
15211536 then {
15221537 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15231538 if ((currentKLp == currentKLp))
15241539 then {
15251540 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15261541 if ((unstakeInv == unstakeInv))
15271542 then {
15281543 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15291544 let outAmAmt = res._1
15301545 let outPrAmt = res._2
15311546 let state = res._10
15321547 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
15331548 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15341549 then true
15351550 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15361551 then true
15371552 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15381553 if ((checkAmounts == checkAmounts))
15391554 then {
15401555 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15411556 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15421557 then {
1543- let $t05828158362 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1544- let refreshKLpActions = $t05828158362._1
1545- let updatedKLp = $t05828158362._2
1558+ let $t05860558686 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1559+ let refreshKLpActions = $t05860558686._1
1560+ let updatedKLp = $t05860558686._2
15461561 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15471562 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15481563 then ((withdrawState ++ state) ++ refreshKLpActions)
15491564 else throw("Strict value is not equal to itself.")
15501565 }
15511566 else throw("Strict value is not equal to itself.")
15521567 }
15531568 else throw("Strict value is not equal to itself.")
15541569 }
15551570 else throw("Strict value is not equal to itself.")
15561571 }
15571572 else throw("Strict value is not equal to itself.")
15581573 }
15591574 else throw("Strict value is not equal to itself.")
15601575 }
15611576
15621577
15631578
15641579 @Callable(i)
15651580 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
15661581 then throw("permissions denied")
15671582 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
15681583
15691584
15701585
15711586 @Callable(i)
15721587 func refreshKLp () = {
15731588 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
15741589 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
15751590 then unit
15761591 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
15771592 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
15781593 then {
15791594 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1580- let $t05956659630 = refreshKLpInternal(0, 0, 0)
1581- let kLpUpdateActions = $t05956659630._1
1582- let updatedKLp = $t05956659630._2
1595+ let $t05989059954 = refreshKLpInternal(0, 0, 0)
1596+ let kLpUpdateActions = $t05989059954._1
1597+ let updatedKLp = $t05989059954._2
15831598 let actions = if ((kLp != updatedKLp))
15841599 then kLpUpdateActions
15851600 else throwErr("nothing to refresh")
15861601 $Tuple2(actions, toString(updatedKLp))
15871602 }
15881603 else throw("Strict value is not equal to itself.")
15891604 }
15901605
15911606
15921607
15931608 @Callable(i)
15941609 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
15951610
15961611
15971612
15981613 @Callable(i)
15991614 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16001615
16011616
16021617
16031618 @Callable(i)
16041619 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16051620 let prices = calcPrices(amAmt, prAmt, lpAmt)
16061621 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
16071622 }
16081623
16091624
16101625
16111626 @Callable(i)
16121627 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
16131628
16141629
16151630
16161631 @Callable(i)
16171632 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
16181633
16191634
16201635
16211636 @Callable(i)
16221637 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
16231638
16241639
16251640
16261641 @Callable(i)
16271642 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
16281643
16291644
16301645
16311646 @Callable(i)
16321647 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
16331648 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
16341649 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
16351650 }
16361651
16371652
16381653
16391654 @Callable(i)
16401655 func statsREADONLY () = {
16411656 let cfg = getPoolConfig()
16421657 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16431658 let amtAssetId = cfg[idxAmtAssetId]
16441659 let priceAssetId = cfg[idxPriceAssetId]
16451660 let iAmtAssetId = cfg[idxIAmtAssetId]
16461661 let iPriceAssetId = cfg[idxIPriceAssetId]
16471662 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16481663 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
16491664 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
16501665 let accAmtAssetBalance = getAccBalance(amtAssetId)
16511666 let accPriceAssetBalance = getAccBalance(priceAssetId)
16521667 let pricesList = if ((poolLPBalance == 0))
16531668 then [zeroBigInt, zeroBigInt, zeroBigInt]
16541669 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
16551670 let curPrice = 0
16561671 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
16571672 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
16581673 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
16591674 $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))
16601675 }
16611676
16621677
16631678
16641679 @Callable(i)
16651680 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
16661681 let cfg = getPoolConfig()
16671682 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16681683 let amAssetIdStr = cfg[idxAmtAssetId]
16691684 let amAssetId = fromBase58String(amAssetIdStr)
16701685 let prAssetIdStr = cfg[idxPriceAssetId]
16711686 let prAssetId = fromBase58String(prAssetIdStr)
16721687 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16731688 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
16741689 let poolStatus = cfg[idxPoolStatus]
16751690 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
16761691 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
16771692 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
16781693 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
16791694 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
16801695 let curPriceX18 = if ((poolLPBalance == 0))
16811696 then zeroBigInt
16821697 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
16831698 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
16841699 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
16851700 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
16861701 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
16871702 let calcLpAmt = estPut._1
16881703 let curPriceCalc = estPut._3
16891704 let amBalance = estPut._4
16901705 let prBalance = estPut._5
16911706 let lpEmission = estPut._6
16921707 $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))
16931708 }
16941709
16951710
16961711
16971712 @Callable(i)
16981713 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
16991714 let cfg = getPoolConfig()
17001715 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17011716 let amAssetIdStr = cfg[idxAmtAssetId]
17021717 let amAssetId = fromBase58String(amAssetIdStr)
17031718 let prAssetIdStr = cfg[idxPriceAssetId]
17041719 let prAssetId = fromBase58String(prAssetIdStr)
17051720 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17061721 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17071722 let poolStatus = cfg[idxPoolStatus]
17081723 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17091724 let amBalanceRaw = getAccBalance(amAssetIdStr)
17101725 let prBalanceRaw = getAccBalance(prAssetIdStr)
17111726 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
17121727 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
17131728 let curPriceX18 = if ((poolLPBalance == 0))
17141729 then zeroBigInt
17151730 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
17161731 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
17171732 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
17181733 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
17191734 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17201735 let calcLpAmt = estPut._1
17211736 let curPriceCalc = estPut._3
17221737 let amBalance = estPut._4
17231738 let prBalance = estPut._5
17241739 let lpEmission = estPut._6
17251740 $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))
17261741 }
17271742
17281743
17291744
17301745 @Callable(i)
17311746 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
17321747 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
17331748 let outAmAmt = res._1
17341749 let outPrAmt = res._2
17351750 let amBalance = res._5
17361751 let prBalance = res._6
17371752 let lpEmission = res._7
17381753 let curPrice = res._8
17391754 let poolStatus = parseIntValue(res._9)
17401755 $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))
17411756 }
17421757
17431758
17441759 @Verifier(tx)
17451760 func verify () = {
17461761 let targetPublicKey = match managerPublicKeyOrUnit() {
17471762 case pk: ByteVector =>
17481763 pk
17491764 case _: Unit =>
17501765 tx.senderPublicKey
17511766 case _ =>
17521767 throw("Match error")
17531768 }
17541769 match tx {
17551770 case order: Order =>
17561771 let matcherPub = getMatcherPubOrFail()
1757- let $t06829268409 = if (skipOrderValidation())
1772+ let $t06861668733 = if (skipOrderValidation())
17581773 then $Tuple2(true, "")
17591774 else validateMatcherOrderAllowed(order)
1760- let orderValid = $t06829268409._1
1761- let orderValidInfo = $t06829268409._2
1775+ let orderValid = $t06861668733._1
1776+ let orderValidInfo = $t06861668733._2
17621777 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17631778 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17641779 if (if (if (orderValid)
17651780 then senderValid
17661781 else false)
17671782 then matcherValid
17681783 else false)
17691784 then true
17701785 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
17711786 case s: SetScriptTransaction =>
17721787 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
17731788 then true
17741789 else {
17751790 let newHash = blake2b256(value(s.script))
17761791 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
17771792 let currentHash = scriptHash(this)
17781793 if ((allowedHash == newHash))
17791794 then (currentHash != newHash)
17801795 else false
17811796 }
17821797 case _ =>
17831798 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
17841799 }
17851800 }
17861801

github/deemru/w8io/026f985 
211.77 ms