tx · HGGF8stZzrhte9PJ4VXgDxyrZEH7syhvdfaFr53tjfat

3N8iNNRC4UfDK4aJctSvHajiZ81fzSumCeP:  -0.04300000 Waves

2023.04.04 17:36 [2519942] smart account 3N8iNNRC4UfDK4aJctSvHajiZ81fzSumCeP > SELF 0.00000000 Waves

{ "type": 13, "id": "HGGF8stZzrhte9PJ4VXgDxyrZEH7syhvdfaFr53tjfat", "fee": 4300000, "feeAssetId": null, "timestamp": 1680619043165, "version": 2, "chainId": 84, "sender": "3N8iNNRC4UfDK4aJctSvHajiZ81fzSumCeP", "senderPublicKey": "F7NZd812aXMUyDcj1XaB3wgMJXJfUsq3RhPhrEZ9b6ND", "proofs": [ "4tZmH1g1DXcZc2Dx2V26UWwRRUpZn7bvk8QGyYys1FAcz3QxKWjqv3CtSwfEQ6idWysGHH51iHoht5N1DFavyUqd" ], "script": "base64:BgLGNwgCEgASBQoDAQQBEgcKBQEEAQgBEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQ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2YWx1ZQEIBQJnbAZzY3JpcHQEAmlzCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYVYJAQJhSAAEAml0CQDxBwEFBHRoaXMDCQAAAgUCaXMFAmlyCQECIT0CBQJpdAUCaXIHCQD0AwMIBQJpbQlib2R5Qnl0ZXMJAJEDAggFAmltBnByb29mcwAABQJpbyeuLy8=", "height": 2519942, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: uiXLf78xSDxL8VY3CzhpV5exwZyga8EFj6D2PXs2ciM Next: GpaGvbTm1qfTceWoVUGx3Kg3wLdDKeXb1dhshkhQ7RJ1 Diff:
OldNewDifferences
10981098 let refreshKLpActions = $t04491145373._1
10991099 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11001100 if ((isUpdatedKLpValid == isUpdatedKLpValid))
1101- then ((state ++ lpTransfer) ++ refreshKLpActions)
1101+ then {
1102+ let reb = invoke(this, "rebalance", nil, nil)
1103+ if ((reb == reb))
1104+ then ((state ++ lpTransfer) ++ refreshKLpActions)
1105+ else throw("Strict value is not equal to itself.")
1106+ }
11021107 else throw("Strict value is not equal to itself.")
11031108 }
11041109 else throw("Strict value is not equal to itself.")
11271132 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11281133 if ((currentKLp == currentKLp))
11291134 then {
1130- let $t04593546000 = refreshKLpInternal(0, 0, 0)
1131- let refreshKLpActions = $t04593546000._1
1132- let updatedKLp = $t04593546000._2
1135+ let $t04598546050 = refreshKLpInternal(0, 0, 0)
1136+ let refreshKLpActions = $t04598546050._1
1137+ let updatedKLp = $t04598546050._2
11331138 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11341139 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11351140 then (state ++ refreshKLpActions)
11761181 then {
11771182 let userAddress = i.caller
11781183 let txId = i.transactionId
1179- let $t04718847340 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1180- if (($t04718847340 == $t04718847340))
1184+ let $t04723847390 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1185+ if (($t04723847390 == $t04723847390))
11811186 then {
1182- let paymentInAmountAsset = $t04718847340._5
1183- let bonus = $t04718847340._4
1184- let feeAmount = $t04718847340._3
1185- let commonState = $t04718847340._2
1186- let emitAmountEstimated = $t04718847340._1
1187+ let paymentInAmountAsset = $t04723847390._5
1188+ let bonus = $t04723847390._4
1189+ let feeAmount = $t04723847390._3
1190+ let commonState = $t04723847390._2
1191+ let emitAmountEstimated = $t04723847390._1
11871192 let emitAmount = if (if ((minOutAmount > 0))
11881193 then (minOutAmount > emitAmountEstimated)
11891194 else false)
12031208 let sendFee = if ((feeAmount > 0))
12041209 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
12051210 else nil
1206- let $t04792648123 = if ((this == feeCollectorAddress))
1211+ let $t04797648173 = if ((this == feeCollectorAddress))
12071212 then $Tuple2(0, 0)
12081213 else if (paymentInAmountAsset)
12091214 then $Tuple2(-(feeAmount), 0)
12101215 else $Tuple2(0, -(feeAmount))
1211- let amountAssetBalanceDelta = $t04792648123._1
1212- let priceAssetBalanceDelta = $t04792648123._2
1213- let $t04812648234 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1214- let refreshKLpActions = $t04812648234._1
1215- let updatedKLp = $t04812648234._2
1216+ let amountAssetBalanceDelta = $t04797648173._1
1217+ let priceAssetBalanceDelta = $t04797648173._2
1218+ let $t04817648284 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1219+ let refreshKLpActions = $t04817648284._1
1220+ let updatedKLp = $t04817648284._2
12161221 let kLp = value(getString(keyKLp))
12171222 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12181223 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12371242
12381243 @Callable(i)
12391244 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1240- let $t04858948746 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1241- let emitAmountEstimated = $t04858948746._1
1242- let commonState = $t04858948746._2
1243- let feeAmount = $t04858948746._3
1244- let bonus = $t04858948746._4
1245- let paymentInAmountAsset = $t04858948746._5
1245+ let $t04863948796 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1246+ let emitAmountEstimated = $t04863948796._1
1247+ let commonState = $t04863948796._2
1248+ let feeAmount = $t04863948796._3
1249+ let bonus = $t04863948796._4
1250+ let paymentInAmountAsset = $t04863948796._5
12461251 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12471252 }
12481253
12791284 then {
12801285 let userAddress = i.caller
12811286 let txId = i.transactionId
1282- let $t04963149784 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1283- if (($t04963149784 == $t04963149784))
1287+ let $t04968149834 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1288+ if (($t04968149834 == $t04968149834))
12841289 then {
1285- let outInAmountAsset = $t04963149784._5
1286- let bonus = $t04963149784._4
1287- let feeAmount = $t04963149784._3
1288- let commonState = $t04963149784._2
1289- let amountEstimated = $t04963149784._1
1290+ let outInAmountAsset = $t04968149834._5
1291+ let bonus = $t04968149834._4
1292+ let feeAmount = $t04968149834._3
1293+ let commonState = $t04968149834._2
1294+ let amountEstimated = $t04968149834._1
12901295 let amount = if (if ((minOutAmount > 0))
12911296 then (minOutAmount > amountEstimated)
12921297 else false)
13081313 let sendFee = if ((feeAmount > 0))
13091314 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13101315 else nil
1311- let $t05054050787 = {
1316+ let $t05059050837 = {
13121317 let feeAmountForCalc = if ((this == feeCollectorAddress))
13131318 then 0
13141319 else feeAmount
13161321 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13171322 else $Tuple2(0, -((amount + feeAmountForCalc)))
13181323 }
1319- let amountAssetBalanceDelta = $t05054050787._1
1320- let priceAssetBalanceDelta = $t05054050787._2
1321- let $t05079050898 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1322- let refreshKLpActions = $t05079050898._1
1323- let updatedKLp = $t05079050898._2
1324+ let amountAssetBalanceDelta = $t05059050837._1
1325+ let priceAssetBalanceDelta = $t05059050837._2
1326+ let $t05084050948 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1327+ let refreshKLpActions = $t05084050948._1
1328+ let updatedKLp = $t05084050948._2
13241329 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13251330 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13261331 then {
13461351
13471352 @Callable(i)
13481353 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1349- let $t05122451380 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1350- let amountEstimated = $t05122451380._1
1351- let commonState = $t05122451380._2
1352- let feeAmount = $t05122451380._3
1353- let bonus = $t05122451380._4
1354- let outInAmountAsset = $t05122451380._5
1354+ let $t05127451430 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1355+ let amountEstimated = $t05127451430._1
1356+ let commonState = $t05127451430._2
1357+ let feeAmount = $t05127451430._3
1358+ let bonus = $t05127451430._4
1359+ let outInAmountAsset = $t05127451430._5
13551360 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13561361 }
13571362
13881393 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13891394 if ((unstakeInv == unstakeInv))
13901395 then {
1391- let $t05228552436 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1392- if (($t05228552436 == $t05228552436))
1396+ let $t05233552486 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1397+ if (($t05233552486 == $t05233552486))
13931398 then {
1394- let outInAmountAsset = $t05228552436._5
1395- let bonus = $t05228552436._4
1396- let feeAmount = $t05228552436._3
1397- let commonState = $t05228552436._2
1398- let amountEstimated = $t05228552436._1
1399+ let outInAmountAsset = $t05233552486._5
1400+ let bonus = $t05233552486._4
1401+ let feeAmount = $t05233552486._3
1402+ let commonState = $t05233552486._2
1403+ let amountEstimated = $t05233552486._1
13991404 let amount = if (if ((minOutAmount > 0))
14001405 then (minOutAmount > amountEstimated)
14011406 else false)
14111416 let sendFee = if ((feeAmount > 0))
14121417 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
14131418 else nil
1414- let $t05300153248 = {
1419+ let $t05305153298 = {
14151420 let feeAmountForCalc = if ((this == feeCollectorAddress))
14161421 then 0
14171422 else feeAmount
14191424 then $Tuple2(-((amount + feeAmountForCalc)), 0)
14201425 else $Tuple2(0, -((amount + feeAmountForCalc)))
14211426 }
1422- let amountAssetBalanceDelta = $t05300153248._1
1423- let priceAssetBalanceDelta = $t05300153248._2
1424- let $t05325153359 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1425- let refreshKLpActions = $t05325153359._1
1426- let updatedKLp = $t05325153359._2
1427+ let amountAssetBalanceDelta = $t05305153298._1
1428+ let priceAssetBalanceDelta = $t05305153298._2
1429+ let $t05330153409 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1430+ let refreshKLpActions = $t05330153409._1
1431+ let updatedKLp = $t05330153409._2
14271432 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14281433 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14291434 then {
14631468 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14641469 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14651470 then {
1466- let $t05437354455 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1467- let refreshKLpActions = $t05437354455._1
1468- let updatedKLp = $t05437354455._2
1471+ let $t05442354505 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1472+ let refreshKLpActions = $t05442354505._1
1473+ let updatedKLp = $t05442354505._2
14691474 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14701475 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14711476 then (state ++ refreshKLpActions)
14971502 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14981503 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14991504 then {
1500- let $t05540455485 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1501- let refreshKLpActions = $t05540455485._1
1502- let updatedKLp = $t05540455485._2
1505+ let $t05545455535 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1506+ let refreshKLpActions = $t05545455535._1
1507+ let updatedKLp = $t05545455535._2
15031508 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15041509 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15051510 then (state ++ refreshKLpActions)
15431548 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15441549 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15451550 then {
1546- let $t05661156692 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1547- let refreshKLpActions = $t05661156692._1
1548- let updatedKLp = $t05661156692._2
1551+ let $t05666156742 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1552+ let refreshKLpActions = $t05666156742._1
1553+ let updatedKLp = $t05666156742._2
15491554 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15501555 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15511556 then (state ++ refreshKLpActions)
15961601 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15971602 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15981603 then {
1599- let $t05798758068 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1600- let refreshKLpActions = $t05798758068._1
1601- let updatedKLp = $t05798758068._2
1604+ let $t05803758118 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1605+ let refreshKLpActions = $t05803758118._1
1606+ let updatedKLp = $t05803758118._2
16021607 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
16031608 if ((isUpdatedKLpValid == isUpdatedKLpValid))
16041609 then (state ++ refreshKLpActions)
16331638 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
16341639 then {
16351640 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1636- let $t05925559319 = refreshKLpInternal(0, 0, 0)
1637- let kLpUpdateActions = $t05925559319._1
1638- let updatedKLp = $t05925559319._2
1641+ let $t05930559369 = refreshKLpInternal(0, 0, 0)
1642+ let kLpUpdateActions = $t05930559369._1
1643+ let updatedKLp = $t05930559369._2
16391644 let actions = if ((kLp != updatedKLp))
16401645 then kLpUpdateActions
16411646 else throwErr("nothing to refresh")
18101815 match tx {
18111816 case order: Order =>
18121817 let matcherPub = getMatcherPubOrFail()
1813- let $t06798168050 = validateMatcherOrderAllowed(order)
1814- let orderValid = $t06798168050._1
1815- let orderValidInfo = $t06798168050._2
1818+ let $t06803168100 = validateMatcherOrderAllowed(order)
1819+ let orderValid = $t06803168100._1
1820+ let orderValidInfo = $t06803168100._2
18161821 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
18171822 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
18181823 if (if (if (orderValid)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func toX18BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
6666
6767
6868 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6969
7070
7171 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
7272
7373
7474 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7575
7676
7777 func abs (val) = if ((0 > val))
7878 then -(val)
7979 else val
8080
8181
8282 func absBigInt (val) = if ((zeroBigInt > val))
8383 then -(val)
8484 else val
8585
8686
8787 func swapContract () = "%s__swapContract"
8888
8989
9090 func fc () = "%s__factoryContract"
9191
9292
9393 func mpk () = "%s__managerPublicKey"
9494
9595
9696 func pmpk () = "%s__pendingManagerPublicKey"
9797
9898
9999 func pl () = "%s%s__price__last"
100100
101101
102102 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
103103
104104
105105 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
106106
107107
108108 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
109109
110110
111111 func aa () = "%s__amountAsset"
112112
113113
114114 func pa () = "%s__priceAsset"
115115
116116
117117 let keyFee = "%s__fee"
118118
119119 let feeDefault = fraction(10, scale8, 10000)
120120
121121 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
122122
123123 let keyKLp = makeString(["%s", "kLp"], SEP)
124124
125125 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
126126
127127 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
128128
129129 let kLpRefreshDelayDefault = 30
130130
131131 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
132132
133133 func keySWavesAssetId () = "%s__sWavesAssetId"
134134
135135
136136 func keySWavesProxyAddress () = "%s__sWavesProxyAddress"
137137
138138
139139 func keyAdditionalBalance (assetId) = makeString(["%s%s", "additionalBalance", assetId], SEP)
140140
141141
142142 func keyStakingAssetBalance (assetId) = makeString(["%s%s", "stakingAssetBalance", assetId], SEP)
143143
144144
145145 func getAdditionalBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyAdditionalBalance(assetId)), 0)
146146
147147
148148 func getStakingAssetBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyStakingAssetBalance(assetId)), 0)
149149
150150
151151 func keyFactoryConfig () = "%s__factoryConfig"
152152
153153
154154 func keyMatcherPub () = "%s%s__matcher__publicKey"
155155
156156
157157 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
158158
159159
160160 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
161161
162162
163163 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
164164
165165
166166 func keyAllPoolsShutdown () = "%s__shutdown"
167167
168168
169169 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
170170
171171
172172 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
173173
174174
175175 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
176176
177177 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
178178
179179
180180 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
181181
182182
183183 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
184184
185185
186186 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
187187
188188
189189 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
190190
191191
192192 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
193193
194194 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
195195
196196 let inFee = {
197197 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
198198 if ($isInstanceOf(@, "Int"))
199199 then @
200200 else throw(($getType(@) + " couldn't be cast to Int"))
201201 }
202202
203203 let outFee = {
204204 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
205205 if ($isInstanceOf(@, "Int"))
206206 then @
207207 else throw(($getType(@) + " couldn't be cast to Int"))
208208 }
209209
210210 func sWavesId () = getStringOrFail(factoryContract, keySWavesAssetId())
211211
212212
213213 func sWavesProxy () = getStringOrFail(factoryContract, keySWavesProxyAddress())
214214
215215
216216 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
217217
218218
219219 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
220220
221221
222222 func getPoolConfig () = {
223223 let amtAsset = getStringOrFail(this, aa())
224224 let priceAsset = getStringOrFail(this, pa())
225225 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
226226 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
227227 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
228228 }
229229
230230
231231 func parseAssetId (input) = if ((input == wavesString))
232232 then unit
233233 else fromBase58String(input)
234234
235235
236236 func assetIdToString (input) = if ((input == unit))
237237 then wavesString
238238 else toBase58String(value(input))
239239
240240
241241 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]))
242242
243243
244244 let poolConfigParsed = parsePoolConfig(getPoolConfig())
245245
246246 let $t092979463 = poolConfigParsed
247247
248248 let cfgPoolAddress = $t092979463._1
249249
250250 let cfgPoolStatus = $t092979463._2
251251
252252 let cfgLpAssetId = $t092979463._3
253253
254254 let cfgAmountAssetId = $t092979463._4
255255
256256 let cfgPriceAssetId = $t092979463._5
257257
258258 let cfgAmountAssetDecimals = $t092979463._6
259259
260260 let cfgPriceAssetDecimals = $t092979463._7
261261
262262 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
263263
264264
265265 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
266266
267267 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
268268
269269 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)
270270
271271
272272 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)
273273
274274
275275 func getAccBalance (assetId) = {
276276 let balanceOnPool = if ((assetId == "WAVES"))
277277 then wavesBalance(this).available
278278 else assetBalance(this, fromBase58String(assetId))
279279 let totalBalance = ((balanceOnPool + getAdditionalBalanceOrZero(assetId)) - getStakingAssetBalanceOrZero(assetId))
280280 max([0, totalBalance])
281281 }
282282
283283
284284 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
285285
286286
287287 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
288288
289289
290290 func getRate (proxy) = {
291291 let inv = invoke(proxy, "getRate", nil, nil)
292292 if ((inv == inv))
293293 then match inv {
294294 case r: Int =>
295295 r
296296 case _ =>
297297 throwErr("proxy.getRate() unexpected value")
298298 }
299299 else throw("Strict value is not equal to itself.")
300300 }
301301
302302
303303 func deposit (assetId,amount,stakingAssetId,proxy) = {
304304 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
305305 if ((currentAdditionalBalance == currentAdditionalBalance))
306306 then {
307307 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
308308 if ((currentStakingAssetBalance == currentStakingAssetBalance))
309309 then {
310310 let asset = parseAssetId(assetId)
311311 if ((amount > 0))
312312 then {
313313 let depositInvoke = invoke(proxy, "deposit", nil, [AttachedPayment(asset, amount)])
314314 if ((depositInvoke == depositInvoke))
315315 then match depositInvoke {
316316 case receivedStakingAsset: Int =>
317317 let newAdditionalBalance = (currentAdditionalBalance + amount)
318318 let newStakingAssetBalance = (currentStakingAssetBalance + receivedStakingAsset)
319319 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance)]
320320 case _ =>
321321 nil
322322 }
323323 else throw("Strict value is not equal to itself.")
324324 }
325325 else nil
326326 }
327327 else throw("Strict value is not equal to itself.")
328328 }
329329 else throw("Strict value is not equal to itself.")
330330 }
331331
332332
333333 func withdraw (assetId,amount,stakingAssetId,proxy,proxyRateMul,profitAddress) = {
334334 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
335335 if ((currentAdditionalBalance == currentAdditionalBalance))
336336 then {
337337 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
338338 if ((currentStakingAssetBalance == currentStakingAssetBalance))
339339 then {
340340 let currentProxyRate = getRate(proxy)
341341 if ((currentProxyRate == currentProxyRate))
342342 then {
343343 let oldRate = fraction(proxyRateMul, currentAdditionalBalance, currentStakingAssetBalance)
344344 let stakingAsset = parseAssetId(stakingAssetId)
345345 let oldSendStakingAmount = fraction(proxyRateMul, amount, oldRate)
346346 let sendStakingAssetAmount = fraction(proxyRateMul, amount, currentProxyRate)
347347 let profitAmount = max([0, (oldSendStakingAmount - sendStakingAssetAmount)])
348348 if ((sendStakingAssetAmount > 0))
349349 then {
350350 let withdrawInvoke = invoke(proxy, "withdraw", nil, [AttachedPayment(stakingAsset, sendStakingAssetAmount)])
351351 if ((withdrawInvoke == withdrawInvoke))
352352 then match withdrawInvoke {
353353 case receivedAssets: Int =>
354354 let newAdditionalBalance = (currentAdditionalBalance - receivedAssets)
355355 let newStakingAssetBalance = ((currentStakingAssetBalance - sendStakingAssetAmount) - profitAmount)
356356 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance), ScriptTransfer(profitAddress, profitAmount, parseAssetId(stakingAssetId))]
357357 case _ =>
358358 nil
359359 }
360360 else throw("Strict value is not equal to itself.")
361361 }
362362 else nil
363363 }
364364 else throw("Strict value is not equal to itself.")
365365 }
366366 else throw("Strict value is not equal to itself.")
367367 }
368368 else throw("Strict value is not equal to itself.")
369369 }
370370
371371
372372 func getLeaseProxyConfig (assetId) = invoke(factoryContract, "getPoolLeaseConfigREADONLY", [toString(this), assetId], nil)
373373
374374
375375 func rebalanceInternal (targetRatio,assetId,stakingAssetId,minBalance,proxy,proxyRateMul,profitAddress) = {
376376 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
377377 if ((currentAdditionalBalance == currentAdditionalBalance))
378378 then {
379379 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
380380 if ((currentStakingAssetBalance == currentStakingAssetBalance))
381381 then {
382382 let availableBalance = match parseAssetId(assetId) {
383383 case b: ByteVector =>
384384 assetBalance(this, b)
385385 case u: Unit =>
386386 wavesBalance(this).available
387387 case _ =>
388388 throw("Match error")
389389 }
390390 if ((availableBalance == availableBalance))
391391 then {
392392 let wholeBalance = max([0, ((availableBalance + currentAdditionalBalance) - minBalance)])
393393 let targetAdditionalBalance = fraction(targetRatio, wholeBalance, 100)
394394 let diff = (currentAdditionalBalance - targetAdditionalBalance)
395395 if ((diff == 0))
396396 then nil
397397 else if ((0 > diff))
398398 then {
399399 let sendAssetAmount = -(diff)
400400 deposit(assetId, sendAssetAmount, stakingAssetId, proxy)
401401 }
402402 else {
403403 let getAssetAmount = diff
404404 withdraw(assetId, getAssetAmount, stakingAssetId, proxy, proxyRateMul, profitAddress)
405405 }
406406 }
407407 else throw("Strict value is not equal to itself.")
408408 }
409409 else throw("Strict value is not equal to itself.")
410410 }
411411 else throw("Strict value is not equal to itself.")
412412 }
413413
414414
415415 func rebalanceAsset (assetId) = match getLeaseProxyConfig(assetId) {
416416 case a: (Boolean, Int, Int, String, String, Int, String) =>
417417 let $t01581415923 = a
418418 let isLeasable = $t01581415923._1
419419 let leasedRatio = $t01581415923._2
420420 let minBalance = $t01581415923._3
421421 let proxyAddress = $t01581415923._4
422422 let proxyAssetId = $t01581415923._5
423423 let proxyRateMul = $t01581415923._6
424424 let stakingProfitAddress = $t01581415923._7
425425 if (isLeasable)
426426 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
427427 else nil
428428 case _ =>
429429 throwErr((("[" + assetId) + "] Rebalance error"))
430430 }
431431
432432
433433 func withdrawAssetWrapper (assetId,amount) = match getLeaseProxyConfig(assetId) {
434434 case a: (Boolean, Int, Int, String, String, Int, String) =>
435435 let $t01645316562 = a
436436 let isLeasable = $t01645316562._1
437437 let leasedRatio = $t01645316562._2
438438 let minBalance = $t01645316562._3
439439 let proxyAddress = $t01645316562._4
440440 let proxyAssetId = $t01645316562._5
441441 let proxyRateMul = $t01645316562._6
442442 let stakingProfitAddress = $t01645316562._7
443443 if (isLeasable)
444444 then withdraw(assetId, amount, proxyAssetId, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
445445 else nil
446446 case _ =>
447447 throwErr((("[" + assetId) + "] withdrawAssetWrapper() error"))
448448 }
449449
450450
451451 func getWithdrawAssetState (assetId,amount) = {
452452 let assetOnPool = match parseAssetId(assetId) {
453453 case b: ByteVector =>
454454 assetBalance(this, b)
455455 case w: Unit =>
456456 wavesBalance(this).available
457457 case _ =>
458458 throw("Match error")
459459 }
460460 if ((amount > assetOnPool))
461461 then {
462462 let amountDiff = (amount - assetOnPool)
463463 withdrawAssetWrapper(assetId, amountDiff)
464464 }
465465 else nil
466466 }
467467
468468
469469 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
470470 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
471471 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
472472 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
473473 }
474474
475475
476476 func calcPrices (amAmt,prAmt,lpAmt) = {
477477 let cfg = getPoolConfig()
478478 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
479479 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
480480 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
481481 let amAmtX18 = toX18(amAmt, amtAssetDcm)
482482 let prAmtX18 = toX18(prAmt, priceAssetDcm)
483483 let lpAmtX18 = toX18(lpAmt, scale8)
484484 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
485485 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
486486 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
487487 }
488488
489489
490490 func calculatePrices (amAmt,prAmt,lpAmt) = {
491491 let prices = calcPrices(amAmt, prAmt, lpAmt)
492492 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
493493 }
494494
495495
496496 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
497497 let cfg = getPoolConfig()
498498 let lpAssetId = cfg[idxPoolLPAssetId]
499499 let amAssetId = cfg[idxAmtAssetId]
500500 let prAssetId = cfg[idxPriceAssetId]
501501 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
502502 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
503503 let poolStatus = cfg[idxPoolStatus]
504504 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
505505 if ((lpAssetId != pmtAssetId))
506506 then throw("Invalid asset passed.")
507507 else {
508508 let amBalance = getAccBalance(amAssetId)
509509 let amBalanceX18 = toX18(amBalance, amAssetDcm)
510510 let prBalance = getAccBalance(prAssetId)
511511 let prBalanceX18 = toX18(prBalance, prAssetDcm)
512512 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
513513 let curPrice = fromX18(curPriceX18, scale8)
514514 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
515515 let lpEmissionX18 = toX18(lpEmission, scale8)
516516 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
517517 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
518518 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
519519 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
520520 let AmAmtWithdrawState = getWithdrawAssetState(amAssetId, outAmAmt)
521521 if ((AmAmtWithdrawState == AmAmtWithdrawState))
522522 then {
523523 let PrAmtWithdrawState = getWithdrawAssetState(prAssetId, outPrAmt)
524524 if ((PrAmtWithdrawState == PrAmtWithdrawState))
525525 then {
526526 let reb = invoke(this, "rebalance", nil, nil)
527527 if ((reb == reb))
528528 then {
529529 let state = if ((txId58 == ""))
530530 then nil
531531 else ((AmAmtWithdrawState ++ PrAmtWithdrawState) ++ [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
532532 then unit
533533 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
534534 then unit
535535 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)])
536536 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
537537 }
538538 else throw("Strict value is not equal to itself.")
539539 }
540540 else throw("Strict value is not equal to itself.")
541541 }
542542 else throw("Strict value is not equal to itself.")
543543 }
544544 }
545545
546546
547547 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
548548 let cfg = getPoolConfig()
549549 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
550550 let amAssetIdStr = cfg[idxAmtAssetId]
551551 let prAssetIdStr = cfg[idxPriceAssetId]
552552 let iAmtAssetId = cfg[idxIAmtAssetId]
553553 let iPriceAssetId = cfg[idxIPriceAssetId]
554554 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
555555 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
556556 let poolStatus = cfg[idxPoolStatus]
557557 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
558558 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
559559 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
560560 if (if ((amAssetIdStr != inAmAssetIdStr))
561561 then true
562562 else (prAssetIdStr != inPrAssetIdStr))
563563 then throw("Invalid amt or price asset passed.")
564564 else {
565565 let amBalance = if (isEvaluate)
566566 then getAccBalance(amAssetIdStr)
567567 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
568568 let prBalance = if (isEvaluate)
569569 then getAccBalance(prAssetIdStr)
570570 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
571571 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
572572 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
573573 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
574574 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
575575 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
576576 let res = if ((lpEmission == 0))
577577 then {
578578 let curPriceX18 = zeroBigInt
579579 let slippageX18 = zeroBigInt
580580 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
581581 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
582582 }
583583 else {
584584 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
585585 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
586586 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
587587 if (if ((curPriceX18 != zeroBigInt))
588588 then (slippageX18 > slippageToleranceX18)
589589 else false)
590590 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
591591 else {
592592 let lpEmissionX18 = toX18(lpEmission, scale8)
593593 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
594594 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
595595 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
596596 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
597597 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
598598 let expAmtAssetAmtX18 = expectedAmts._1
599599 let expPriceAssetAmtX18 = expectedAmts._2
600600 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
601601 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
602602 }
603603 }
604604 let calcLpAmt = res._1
605605 let calcAmAssetPmt = res._2
606606 let calcPrAssetPmt = res._3
607607 let curPrice = fromX18(res._4, scale8)
608608 let slippageCalc = fromX18(res._5, scale8)
609609 if ((0 >= calcLpAmt))
610610 then throw("Invalid calculations. LP calculated is less than zero.")
611611 else {
612612 let emitLpAmt = if (!(emitLp))
613613 then 0
614614 else calcLpAmt
615615 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
616616 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
617617 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))]
618618 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
619619 }
620620 }
621621 }
622622
623623
624624 func calcKLp (amountBalance,priceBalance,lpEmission) = {
625625 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
626626 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
627627 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
628628 if ((lpEmission == big0))
629629 then big0
630630 else updatedKLp
631631 }
632632
633633
634634 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
635635 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
636636 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
637637 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
638638 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
639639 currentKLp
640640 }
641641
642642
643643 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
644644 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
645645 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
646646 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
647647 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
648648 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
649649 $Tuple2(actions, updatedKLp)
650650 }
651651
652652
653653 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
654654 then true
655655 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
656656
657657
658658 func validateMatcherOrderAllowed (order) = {
659659 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
660660 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
661661 let amountAssetAmount = order.amount
662662 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
663663 let $t02880029012 = if ((order.orderType == Buy))
664664 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
665665 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
666666 let amountAssetBalanceDelta = $t02880029012._1
667667 let priceAssetBalanceDelta = $t02880029012._2
668668 if (if (if (isGlobalShutdown())
669669 then true
670670 else (cfgPoolStatus == PoolMatcherDisabled))
671671 then true
672672 else (cfgPoolStatus == PoolShutdown))
673673 then throw("Exchange operations disabled")
674674 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
675675 then true
676676 else (order.assetPair.priceAsset != cfgPriceAssetId))
677677 then throw("Wrong order assets.")
678678 else {
679679 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
680680 let $t02945229552 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
681681 let unusedActions = $t02945229552._1
682682 let kLpNew = $t02945229552._2
683683 let isOrderValid = (kLpNew >= kLp)
684684 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
685685 $Tuple2(isOrderValid, info)
686686 }
687687 }
688688
689689
690690 func commonGet (i) = if ((size(i.payments) != 1))
691691 then throw("exactly 1 payment is expected")
692692 else {
693693 let pmt = value(i.payments[0])
694694 let pmtAssetId = value(pmt.assetId)
695695 let pmtAmt = pmt.amount
696696 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
697697 let outAmAmt = res._1
698698 let outPrAmt = res._2
699699 let poolStatus = parseIntValue(res._9)
700700 let state = res._10
701701 if (if (isGlobalShutdown())
702702 then true
703703 else (poolStatus == PoolShutdown))
704704 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
705705 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
706706 }
707707
708708
709709 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
710710 then throw("exactly 2 payments are expected")
711711 else {
712712 let amAssetPmt = value(i.payments[0])
713713 let prAssetPmt = value(i.payments[1])
714714 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
715715 let poolStatus = parseIntValue(estPut._8)
716716 if (if (if (isGlobalShutdown())
717717 then true
718718 else (poolStatus == PoolPutDisabled))
719719 then true
720720 else (poolStatus == PoolShutdown))
721721 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
722722 else estPut
723723 }
724724
725725
726726 func emit (amount) = {
727727 let emitInv = invoke(factoryContract, "emit", [amount], nil)
728728 if ((emitInv == emitInv))
729729 then {
730730 let emitInvLegacy = match emitInv {
731731 case legacyFactoryContract: Address =>
732732 invoke(legacyFactoryContract, "emit", [amount], nil)
733733 case _ =>
734734 unit
735735 }
736736 if ((emitInvLegacy == emitInvLegacy))
737737 then amount
738738 else throw("Strict value is not equal to itself.")
739739 }
740740 else throw("Strict value is not equal to itself.")
741741 }
742742
743743
744744 func takeFee (amount,fee) = {
745745 let feeAmount = if ((fee == 0))
746746 then 0
747747 else fraction(amount, fee, scale8)
748748 $Tuple2((amount - feeAmount), feeAmount)
749749 }
750750
751751
752752 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
753753 let isEval = (txId == unit)
754754 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
755755 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
756756 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
757757 then true
758758 else if ((paymentAssetId == cfgPriceAssetId))
759759 then false
760760 else throwErr("invalid asset")
761761 let $t03266532958 = if (isEval)
762762 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
763763 else if (paymentInAmountAsset)
764764 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
765765 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
766766 let amountBalanceOld = $t03266532958._1
767767 let priceBalanceOld = $t03266532958._2
768768 let $t03296233111 = if (paymentInAmountAsset)
769769 then $Tuple2(paymentAmountRaw, 0)
770770 else $Tuple2(0, paymentAmountRaw)
771771 let amountAssetAmountRaw = $t03296233111._1
772772 let priceAssetAmountRaw = $t03296233111._2
773773 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
774774 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
775775 let $t03324333307 = takeFee(paymentAmountRaw, inFee)
776776 let paymentAmount = $t03324333307._1
777777 let feeAmount = $t03324333307._2
778778 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
779779 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
780780 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
781781 let priceNew = fromX18(priceNewX18, scale8)
782782 let paymentBalance = if (paymentInAmountAsset)
783783 then amountBalanceOld
784784 else priceBalanceOld
785785 let paymentBalanceBigInt = toBigInt(paymentBalance)
786786 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
787787 let chechSupply = if ((supplyBigInt > big0))
788788 then true
789789 else throwErr("initial deposit requires all coins")
790790 if ((chechSupply == chechSupply))
791791 then {
792792 let depositBigInt = toBigInt(paymentAmount)
793793 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
794794 let commonState = if (isEval)
795795 then nil
796796 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))]
797797 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
798798 let priceOld = fromX18(priceOldX18, scale8)
799799 let loss = {
800800 let $t03498835155 = if (paymentInAmountAsset)
801801 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
802802 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
803803 let amount = $t03498835155._1
804804 let balance = $t03498835155._2
805805 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
806806 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
807807 }
808808 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
809809 }
810810 else throw("Strict value is not equal to itself.")
811811 }
812812
813813
814814 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
815815 let isEval = (txId == unit)
816816 let cfg = getPoolConfig()
817817 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
818818 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
819819 let checks = [if ((paymentAssetId == cfgLpAssetId))
820820 then true
821821 else throwErr("invalid lp asset")]
822822 if ((checks == checks))
823823 then {
824824 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
825825 then true
826826 else if ((outAssetId == cfgPriceAssetId))
827827 then false
828828 else throwErr("invalid asset")
829829 let balanceBigInt = if (outInAmountAsset)
830830 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
831831 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
832832 let outInAmountAssetDecimals = if (outInAmountAsset)
833833 then amtAssetDcm
834834 else priceAssetDcm
835835 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
836836 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
837837 let outBalance = if (outInAmountAsset)
838838 then amBalanceOld
839839 else prBalanceOld
840840 let outBalanceBigInt = toBigInt(outBalance)
841841 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
842842 let redeemedBigInt = toBigInt(paymentAmount)
843843 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
844844 let $t03723337289 = takeFee(amountRaw, outFee)
845845 let totalAmount = $t03723337289._1
846846 let feeAmount = $t03723337289._2
847847 let $t03729337519 = if (outInAmountAsset)
848848 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
849849 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
850850 let outAmAmount = $t03729337519._1
851851 let outPrAmount = $t03729337519._2
852852 let amBalanceNew = $t03729337519._3
853853 let prBalanceNew = $t03729337519._4
854854 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
855855 let priceNew = fromX18(priceNewX18, scale8)
856856 let commonState = if (isEval)
857857 then nil
858858 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)]
859859 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
860860 let priceOld = fromX18(priceOldX18, scale8)
861861 let loss = {
862862 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
863863 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
864864 }
865865 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
866866 }
867867 else throw("Strict value is not equal to itself.")
868868 }
869869
870870
871871 func managerPublicKeyOrUnit () = match getString(mpk()) {
872872 case s: String =>
873873 fromBase58String(s)
874874 case _: Unit =>
875875 unit
876876 case _ =>
877877 throw("Match error")
878878 }
879879
880880
881881 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
882882 case s: String =>
883883 fromBase58String(s)
884884 case _: Unit =>
885885 unit
886886 case _ =>
887887 throw("Match error")
888888 }
889889
890890
891891 func isManager (i) = match managerPublicKeyOrUnit() {
892892 case pk: ByteVector =>
893893 (i.callerPublicKey == pk)
894894 case _: Unit =>
895895 (i.caller == this)
896896 case _ =>
897897 throw("Match error")
898898 }
899899
900900
901901 func mustManager (i) = {
902902 let pd = throw("Permission denied")
903903 match managerPublicKeyOrUnit() {
904904 case pk: ByteVector =>
905905 if ((i.callerPublicKey == pk))
906906 then true
907907 else pd
908908 case _: Unit =>
909909 if ((i.caller == this))
910910 then true
911911 else pd
912912 case _ =>
913913 throw("Match error")
914914 }
915915 }
916916
917917
918918 @Callable(i)
919919 func rebalance () = (rebalanceAsset(getStringOrFail(this, aa())) ++ rebalanceAsset(getStringOrFail(this, pa())))
920920
921921
922922
923923 @Callable(i)
924924 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
925925 let $t03940539710 = if ((isReverse == false))
926926 then {
927927 let assetOut = getStringOrFail(this, pa())
928928 let assetIn = getStringOrFail(this, aa())
929929 $Tuple2(assetOut, assetIn)
930930 }
931931 else {
932932 let assetOut = getStringOrFail(this, aa())
933933 let assetIn = getStringOrFail(this, pa())
934934 $Tuple2(assetOut, assetIn)
935935 }
936936 let assetOut = $t03940539710._1
937937 let assetIn = $t03940539710._2
938938 let poolAssetInBalance = getAccBalance(assetIn)
939939 let poolAssetOutBalance = getAccBalance(assetOut)
940940 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
941941 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
942942 let newK = (((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
943943 let checkK = if ((newK >= oldK))
944944 then true
945945 else throw("new K is fewer error")
946946 if ((checkK == checkK))
947947 then $Tuple2(nil, amountOut)
948948 else throw("Strict value is not equal to itself.")
949949 }
950950
951951
952952
953953 @Callable(i)
954954 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
955955 let swapContact = {
956956 let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
957957 if ($isInstanceOf(@, "String"))
958958 then @
959959 else throw(($getType(@) + " couldn't be cast to String"))
960960 }
961961 let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
962962 then true
963963 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
964964 then true
965965 else throwErr("Permission denied")]
966966 if ((checks == checks))
967967 then {
968968 let pmt = value(i.payments[0])
969969 let assetIn = assetIdToString(pmt.assetId)
970970 let assetOut = if ((isReverse == false))
971971 then getStringOrFail(this, pa())
972972 else getStringOrFail(this, aa())
973973 let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
974974 let poolAssetOutBalance = getAccBalance(assetOut)
975975 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
976976 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
977977 let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
978978 let checkK = if ((newK >= oldK))
979979 then true
980980 else throw("new K is fewer error")
981981 if ((checkK == checkK))
982982 then {
983983 let checkMin = if ((amountOut >= amountOutMin))
984984 then true
985985 else throw("Exchange result is fewer coins than expected")
986986 if ((checkMin == checkMin))
987987 then {
988988 let lsConf = match getLeaseProxyConfig(assetOut) {
989989 case a: (Boolean, Int, Int, String, String, Int, String) =>
990990 a
991991 case _ =>
992992 throw("error lease config")
993993 }
994994 let withdrawState = getWithdrawAssetState(assetOut, amountOut)
995995 if ((withdrawState == withdrawState))
996996 then {
997997 let reb = invoke(this, "rebalance", nil, nil)
998998 if ((reb == reb))
999999 then $Tuple2((withdrawState ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
10001000 else throw("Strict value is not equal to itself.")
10011001 }
10021002 else throw("Strict value is not equal to itself.")
10031003 }
10041004 else throw("Strict value is not equal to itself.")
10051005 }
10061006 else throw("Strict value is not equal to itself.")
10071007 }
10081008 else throw("Strict value is not equal to itself.")
10091009 }
10101010
10111011
10121012
10131013 @Callable(i)
10141014 func setManager (pendingManagerPublicKey) = {
10151015 let checkCaller = mustManager(i)
10161016 if ((checkCaller == checkCaller))
10171017 then {
10181018 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
10191019 if ((checkManagerPublicKey == checkManagerPublicKey))
10201020 then [StringEntry(pmpk(), pendingManagerPublicKey)]
10211021 else throw("Strict value is not equal to itself.")
10221022 }
10231023 else throw("Strict value is not equal to itself.")
10241024 }
10251025
10261026
10271027
10281028 @Callable(i)
10291029 func confirmManager () = {
10301030 let pm = pendingManagerPublicKeyOrUnit()
10311031 let hasPM = if (isDefined(pm))
10321032 then true
10331033 else throw("No pending manager")
10341034 if ((hasPM == hasPM))
10351035 then {
10361036 let checkPM = if ((i.callerPublicKey == value(pm)))
10371037 then true
10381038 else throw("You are not pending manager")
10391039 if ((checkPM == checkPM))
10401040 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
10411041 else throw("Strict value is not equal to itself.")
10421042 }
10431043 else throw("Strict value is not equal to itself.")
10441044 }
10451045
10461046
10471047
10481048 @Callable(i)
10491049 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
10501050 then throw("Invalid slippageTolerance passed")
10511051 else {
10521052 let estPut = commonPut(i, slippageTolerance, true)
10531053 let emitLpAmt = estPut._2
10541054 let lpAssetId = estPut._7
10551055 let state = estPut._9
10561056 let amDiff = estPut._10
10571057 let prDiff = estPut._11
10581058 let amId = estPut._12
10591059 let prId = estPut._13
10601060 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10611061 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10621062 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10631063 if ((currentKLp == currentKLp))
10641064 then {
10651065 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
10661066 if ((emitInv == emitInv))
10671067 then {
10681068 let emitInvLegacy = match emitInv {
10691069 case legacyFactoryContract: Address =>
10701070 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
10711071 case _ =>
10721072 unit
10731073 }
10741074 if ((emitInvLegacy == emitInvLegacy))
10751075 then {
10761076 let slippageAInv = if ((amDiff > 0))
10771077 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
10781078 else nil
10791079 if ((slippageAInv == slippageAInv))
10801080 then {
10811081 let slippagePInv = if ((prDiff > 0))
10821082 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
10831083 else nil
10841084 if ((slippagePInv == slippagePInv))
10851085 then {
10861086 let lpTransfer = if (shouldAutoStake)
10871087 then {
10881088 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
10891089 if ((slpStakeInv == slpStakeInv))
10901090 then nil
10911091 else throw("Strict value is not equal to itself.")
10921092 }
10931093 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
10941094 let $t04491145373 = refreshKLpInternal(0, 0, 0)
10951095 if (($t04491145373 == $t04491145373))
10961096 then {
10971097 let updatedKLp = $t04491145373._2
10981098 let refreshKLpActions = $t04491145373._1
10991099 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11001100 if ((isUpdatedKLpValid == isUpdatedKLpValid))
1101- then ((state ++ lpTransfer) ++ refreshKLpActions)
1101+ then {
1102+ let reb = invoke(this, "rebalance", nil, nil)
1103+ if ((reb == reb))
1104+ then ((state ++ lpTransfer) ++ refreshKLpActions)
1105+ else throw("Strict value is not equal to itself.")
1106+ }
11021107 else throw("Strict value is not equal to itself.")
11031108 }
11041109 else throw("Strict value is not equal to itself.")
11051110 }
11061111 else throw("Strict value is not equal to itself.")
11071112 }
11081113 else throw("Strict value is not equal to itself.")
11091114 }
11101115 else throw("Strict value is not equal to itself.")
11111116 }
11121117 else throw("Strict value is not equal to itself.")
11131118 }
11141119 else throw("Strict value is not equal to itself.")
11151120 }
11161121
11171122
11181123
11191124 @Callable(i)
11201125 func putForFree (maxSlippage) = if ((0 > maxSlippage))
11211126 then throw("Invalid value passed")
11221127 else {
11231128 let estPut = commonPut(i, maxSlippage, false)
11241129 let state = estPut._9
11251130 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11261131 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11271132 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11281133 if ((currentKLp == currentKLp))
11291134 then {
1130- let $t04593546000 = refreshKLpInternal(0, 0, 0)
1131- let refreshKLpActions = $t04593546000._1
1132- let updatedKLp = $t04593546000._2
1135+ let $t04598546050 = refreshKLpInternal(0, 0, 0)
1136+ let refreshKLpActions = $t04598546050._1
1137+ let updatedKLp = $t04598546050._2
11331138 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11341139 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11351140 then (state ++ refreshKLpActions)
11361141 else throw("Strict value is not equal to itself.")
11371142 }
11381143 else throw("Strict value is not equal to itself.")
11391144 }
11401145
11411146
11421147
11431148 @Callable(i)
11441149 func putOneTkn (minOutAmount,autoStake) = {
11451150 let isPoolOneTokenOperationsDisabled = {
11461151 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11471152 if ($isInstanceOf(@, "Boolean"))
11481153 then @
11491154 else throw(($getType(@) + " couldn't be cast to Boolean"))
11501155 }
11511156 let isPutDisabled = if (if (if (isGlobalShutdown())
11521157 then true
11531158 else (cfgPoolStatus == PoolPutDisabled))
11541159 then true
11551160 else (cfgPoolStatus == PoolShutdown))
11561161 then true
11571162 else isPoolOneTokenOperationsDisabled
11581163 let checks = [if (if (!(isPutDisabled))
11591164 then true
11601165 else isManager(i))
11611166 then true
11621167 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
11631168 then true
11641169 else throwErr("exactly 1 payment are expected")]
11651170 if ((checks == checks))
11661171 then {
11671172 let payment = i.payments[0]
11681173 let paymentAssetId = payment.assetId
11691174 let paymentAmountRaw = payment.amount
11701175 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
11711176 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
11721177 else if ((paymentAssetId == cfgPriceAssetId))
11731178 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
11741179 else throwErr("payment asset is not supported")
11751180 if ((currentKLp == currentKLp))
11761181 then {
11771182 let userAddress = i.caller
11781183 let txId = i.transactionId
1179- let $t04718847340 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1180- if (($t04718847340 == $t04718847340))
1184+ let $t04723847390 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1185+ if (($t04723847390 == $t04723847390))
11811186 then {
1182- let paymentInAmountAsset = $t04718847340._5
1183- let bonus = $t04718847340._4
1184- let feeAmount = $t04718847340._3
1185- let commonState = $t04718847340._2
1186- let emitAmountEstimated = $t04718847340._1
1187+ let paymentInAmountAsset = $t04723847390._5
1188+ let bonus = $t04723847390._4
1189+ let feeAmount = $t04723847390._3
1190+ let commonState = $t04723847390._2
1191+ let emitAmountEstimated = $t04723847390._1
11871192 let emitAmount = if (if ((minOutAmount > 0))
11881193 then (minOutAmount > emitAmountEstimated)
11891194 else false)
11901195 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
11911196 else emitAmountEstimated
11921197 let emitInv = emit(emitAmount)
11931198 if ((emitInv == emitInv))
11941199 then {
11951200 let lpTransfer = if (autoStake)
11961201 then {
11971202 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
11981203 if ((stakeInv == stakeInv))
11991204 then nil
12001205 else throw("Strict value is not equal to itself.")
12011206 }
12021207 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
12031208 let sendFee = if ((feeAmount > 0))
12041209 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
12051210 else nil
1206- let $t04792648123 = if ((this == feeCollectorAddress))
1211+ let $t04797648173 = if ((this == feeCollectorAddress))
12071212 then $Tuple2(0, 0)
12081213 else if (paymentInAmountAsset)
12091214 then $Tuple2(-(feeAmount), 0)
12101215 else $Tuple2(0, -(feeAmount))
1211- let amountAssetBalanceDelta = $t04792648123._1
1212- let priceAssetBalanceDelta = $t04792648123._2
1213- let $t04812648234 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1214- let refreshKLpActions = $t04812648234._1
1215- let updatedKLp = $t04812648234._2
1216+ let amountAssetBalanceDelta = $t04797648173._1
1217+ let priceAssetBalanceDelta = $t04797648173._2
1218+ let $t04817648284 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1219+ let refreshKLpActions = $t04817648284._1
1220+ let updatedKLp = $t04817648284._2
12161221 let kLp = value(getString(keyKLp))
12171222 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12181223 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12191224 then {
12201225 let reb = invoke(this, "rebalance", nil, nil)
12211226 if ((reb == reb))
12221227 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
12231228 else throw("Strict value is not equal to itself.")
12241229 }
12251230 else throw("Strict value is not equal to itself.")
12261231 }
12271232 else throw("Strict value is not equal to itself.")
12281233 }
12291234 else throw("Strict value is not equal to itself.")
12301235 }
12311236 else throw("Strict value is not equal to itself.")
12321237 }
12331238 else throw("Strict value is not equal to itself.")
12341239 }
12351240
12361241
12371242
12381243 @Callable(i)
12391244 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1240- let $t04858948746 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1241- let emitAmountEstimated = $t04858948746._1
1242- let commonState = $t04858948746._2
1243- let feeAmount = $t04858948746._3
1244- let bonus = $t04858948746._4
1245- let paymentInAmountAsset = $t04858948746._5
1245+ let $t04863948796 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1246+ let emitAmountEstimated = $t04863948796._1
1247+ let commonState = $t04863948796._2
1248+ let feeAmount = $t04863948796._3
1249+ let bonus = $t04863948796._4
1250+ let paymentInAmountAsset = $t04863948796._5
12461251 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12471252 }
12481253
12491254
12501255
12511256 @Callable(i)
12521257 func getOneTkn (outAssetIdStr,minOutAmount) = {
12531258 let isPoolOneTokenOperationsDisabled = {
12541259 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12551260 if ($isInstanceOf(@, "Boolean"))
12561261 then @
12571262 else throw(($getType(@) + " couldn't be cast to Boolean"))
12581263 }
12591264 let isGetDisabled = if (if (isGlobalShutdown())
12601265 then true
12611266 else (cfgPoolStatus == PoolShutdown))
12621267 then true
12631268 else isPoolOneTokenOperationsDisabled
12641269 let checks = [if (if (!(isGetDisabled))
12651270 then true
12661271 else isManager(i))
12671272 then true
12681273 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
12691274 then true
12701275 else throwErr("exactly 1 payment are expected")]
12711276 if ((checks == checks))
12721277 then {
12731278 let outAssetId = parseAssetId(outAssetIdStr)
12741279 let payment = i.payments[0]
12751280 let paymentAssetId = payment.assetId
12761281 let paymentAmount = payment.amount
12771282 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12781283 if ((currentKLp == currentKLp))
12791284 then {
12801285 let userAddress = i.caller
12811286 let txId = i.transactionId
1282- let $t04963149784 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1283- if (($t04963149784 == $t04963149784))
1287+ let $t04968149834 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1288+ if (($t04968149834 == $t04968149834))
12841289 then {
1285- let outInAmountAsset = $t04963149784._5
1286- let bonus = $t04963149784._4
1287- let feeAmount = $t04963149784._3
1288- let commonState = $t04963149784._2
1289- let amountEstimated = $t04963149784._1
1290+ let outInAmountAsset = $t04968149834._5
1291+ let bonus = $t04968149834._4
1292+ let feeAmount = $t04968149834._3
1293+ let commonState = $t04968149834._2
1294+ let amountEstimated = $t04968149834._1
12901295 let amount = if (if ((minOutAmount > 0))
12911296 then (minOutAmount > amountEstimated)
12921297 else false)
12931298 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12941299 else amountEstimated
12951300 let lsConf = match getLeaseProxyConfig(outAssetIdStr) {
12961301 case a: (Boolean, Int, Int, String, String, Int, String) =>
12971302 a
12981303 case _ =>
12991304 throw("error lease config")
13001305 }
13011306 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
13021307 if ((burnInv == burnInv))
13031308 then {
13041309 let withdrawState = getWithdrawAssetState(outAssetIdStr, amount)
13051310 if ((withdrawState == withdrawState))
13061311 then {
13071312 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
13081313 let sendFee = if ((feeAmount > 0))
13091314 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13101315 else nil
1311- let $t05054050787 = {
1316+ let $t05059050837 = {
13121317 let feeAmountForCalc = if ((this == feeCollectorAddress))
13131318 then 0
13141319 else feeAmount
13151320 if (outInAmountAsset)
13161321 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13171322 else $Tuple2(0, -((amount + feeAmountForCalc)))
13181323 }
1319- let amountAssetBalanceDelta = $t05054050787._1
1320- let priceAssetBalanceDelta = $t05054050787._2
1321- let $t05079050898 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1322- let refreshKLpActions = $t05079050898._1
1323- let updatedKLp = $t05079050898._2
1324+ let amountAssetBalanceDelta = $t05059050837._1
1325+ let priceAssetBalanceDelta = $t05059050837._2
1326+ let $t05084050948 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1327+ let refreshKLpActions = $t05084050948._1
1328+ let updatedKLp = $t05084050948._2
13241329 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13251330 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13261331 then {
13271332 let reb = invoke(this, "rebalance", nil, nil)
13281333 if ((reb == reb))
13291334 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13301335 else throw("Strict value is not equal to itself.")
13311336 }
13321337 else throw("Strict value is not equal to itself.")
13331338 }
13341339 else throw("Strict value is not equal to itself.")
13351340 }
13361341 else throw("Strict value is not equal to itself.")
13371342 }
13381343 else throw("Strict value is not equal to itself.")
13391344 }
13401345 else throw("Strict value is not equal to itself.")
13411346 }
13421347 else throw("Strict value is not equal to itself.")
13431348 }
13441349
13451350
13461351
13471352 @Callable(i)
13481353 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1349- let $t05122451380 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1350- let amountEstimated = $t05122451380._1
1351- let commonState = $t05122451380._2
1352- let feeAmount = $t05122451380._3
1353- let bonus = $t05122451380._4
1354- let outInAmountAsset = $t05122451380._5
1354+ let $t05127451430 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1355+ let amountEstimated = $t05127451430._1
1356+ let commonState = $t05127451430._2
1357+ let feeAmount = $t05127451430._3
1358+ let bonus = $t05127451430._4
1359+ let outInAmountAsset = $t05127451430._5
13551360 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13561361 }
13571362
13581363
13591364
13601365 @Callable(i)
13611366 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
13621367 let isPoolOneTokenOperationsDisabled = {
13631368 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13641369 if ($isInstanceOf(@, "Boolean"))
13651370 then @
13661371 else throw(($getType(@) + " couldn't be cast to Boolean"))
13671372 }
13681373 let isGetDisabled = if (if (isGlobalShutdown())
13691374 then true
13701375 else (cfgPoolStatus == PoolShutdown))
13711376 then true
13721377 else isPoolOneTokenOperationsDisabled
13731378 let checks = [if (if (!(isGetDisabled))
13741379 then true
13751380 else isManager(i))
13761381 then true
13771382 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
13781383 then true
13791384 else throwErr("no payments are expected")]
13801385 if ((checks == checks))
13811386 then {
13821387 let outAssetId = parseAssetId(outAssetIdStr)
13831388 let userAddress = i.caller
13841389 let txId = i.transactionId
13851390 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
13861391 if ((currentKLp == currentKLp))
13871392 then {
13881393 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13891394 if ((unstakeInv == unstakeInv))
13901395 then {
1391- let $t05228552436 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1392- if (($t05228552436 == $t05228552436))
1396+ let $t05233552486 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1397+ if (($t05233552486 == $t05233552486))
13931398 then {
1394- let outInAmountAsset = $t05228552436._5
1395- let bonus = $t05228552436._4
1396- let feeAmount = $t05228552436._3
1397- let commonState = $t05228552436._2
1398- let amountEstimated = $t05228552436._1
1399+ let outInAmountAsset = $t05233552486._5
1400+ let bonus = $t05233552486._4
1401+ let feeAmount = $t05233552486._3
1402+ let commonState = $t05233552486._2
1403+ let amountEstimated = $t05233552486._1
13991404 let amount = if (if ((minOutAmount > 0))
14001405 then (minOutAmount > amountEstimated)
14011406 else false)
14021407 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
14031408 else amountEstimated
14041409 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
14051410 if ((burnInv == burnInv))
14061411 then {
14071412 let withdrawState = getWithdrawAssetState(outAssetIdStr, amount)
14081413 if ((withdrawState == withdrawState))
14091414 then {
14101415 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
14111416 let sendFee = if ((feeAmount > 0))
14121417 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
14131418 else nil
1414- let $t05300153248 = {
1419+ let $t05305153298 = {
14151420 let feeAmountForCalc = if ((this == feeCollectorAddress))
14161421 then 0
14171422 else feeAmount
14181423 if (outInAmountAsset)
14191424 then $Tuple2(-((amount + feeAmountForCalc)), 0)
14201425 else $Tuple2(0, -((amount + feeAmountForCalc)))
14211426 }
1422- let amountAssetBalanceDelta = $t05300153248._1
1423- let priceAssetBalanceDelta = $t05300153248._2
1424- let $t05325153359 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1425- let refreshKLpActions = $t05325153359._1
1426- let updatedKLp = $t05325153359._2
1427+ let amountAssetBalanceDelta = $t05305153298._1
1428+ let priceAssetBalanceDelta = $t05305153298._2
1429+ let $t05330153409 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1430+ let refreshKLpActions = $t05330153409._1
1431+ let updatedKLp = $t05330153409._2
14271432 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14281433 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14291434 then {
14301435 let reb = invoke(this, "rebalance", nil, nil)
14311436 if ((reb == reb))
14321437 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14331438 else throw("Strict value is not equal to itself.")
14341439 }
14351440 else throw("Strict value is not equal to itself.")
14361441 }
14371442 else throw("Strict value is not equal to itself.")
14381443 }
14391444 else throw("Strict value is not equal to itself.")
14401445 }
14411446 else throw("Strict value is not equal to itself.")
14421447 }
14431448 else throw("Strict value is not equal to itself.")
14441449 }
14451450 else throw("Strict value is not equal to itself.")
14461451 }
14471452 else throw("Strict value is not equal to itself.")
14481453 }
14491454
14501455
14511456
14521457 @Callable(i)
14531458 func get () = {
14541459 let res = commonGet(i)
14551460 let outAmtAmt = res._1
14561461 let outPrAmt = res._2
14571462 let pmtAmt = res._3
14581463 let pmtAssetId = res._4
14591464 let state = res._5
14601465 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14611466 if ((currentKLp == currentKLp))
14621467 then {
14631468 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14641469 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14651470 then {
1466- let $t05437354455 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1467- let refreshKLpActions = $t05437354455._1
1468- let updatedKLp = $t05437354455._2
1471+ let $t05442354505 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1472+ let refreshKLpActions = $t05442354505._1
1473+ let updatedKLp = $t05442354505._2
14691474 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14701475 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14711476 then (state ++ refreshKLpActions)
14721477 else throw("Strict value is not equal to itself.")
14731478 }
14741479 else throw("Strict value is not equal to itself.")
14751480 }
14761481 else throw("Strict value is not equal to itself.")
14771482 }
14781483
14791484
14801485
14811486 @Callable(i)
14821487 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14831488 let res = commonGet(i)
14841489 let outAmAmt = res._1
14851490 let outPrAmt = res._2
14861491 let pmtAmt = res._3
14871492 let pmtAssetId = res._4
14881493 let state = res._5
14891494 if ((noLessThenAmtAsset > outAmAmt))
14901495 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14911496 else if ((noLessThenPriceAsset > outPrAmt))
14921497 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14931498 else {
14941499 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14951500 if ((currentKLp == currentKLp))
14961501 then {
14971502 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14981503 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14991504 then {
1500- let $t05540455485 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1501- let refreshKLpActions = $t05540455485._1
1502- let updatedKLp = $t05540455485._2
1505+ let $t05545455535 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1506+ let refreshKLpActions = $t05545455535._1
1507+ let updatedKLp = $t05545455535._2
15031508 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15041509 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15051510 then (state ++ refreshKLpActions)
15061511 else throw("Strict value is not equal to itself.")
15071512 }
15081513 else throw("Strict value is not equal to itself.")
15091514 }
15101515 else throw("Strict value is not equal to itself.")
15111516 }
15121517 }
15131518
15141519
15151520
15161521 @Callable(i)
15171522 func unstakeAndGet (amount) = {
15181523 let checkPayments = if ((size(i.payments) != 0))
15191524 then throw("No payments are expected")
15201525 else true
15211526 if ((checkPayments == checkPayments))
15221527 then {
15231528 let cfg = getPoolConfig()
15241529 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
15251530 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15261531 if ((currentKLp == currentKLp))
15271532 then {
15281533 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
15291534 if ((unstakeInv == unstakeInv))
15301535 then {
15311536 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
15321537 let outAmAmt = res._1
15331538 let outPrAmt = res._2
15341539 let poolStatus = parseIntValue(res._9)
15351540 let state = res._10
15361541 let checkPoolStatus = if (if (isGlobalShutdown())
15371542 then true
15381543 else (poolStatus == PoolShutdown))
15391544 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
15401545 else true
15411546 if ((checkPoolStatus == checkPoolStatus))
15421547 then {
15431548 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15441549 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15451550 then {
1546- let $t05661156692 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1547- let refreshKLpActions = $t05661156692._1
1548- let updatedKLp = $t05661156692._2
1551+ let $t05666156742 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1552+ let refreshKLpActions = $t05666156742._1
1553+ let updatedKLp = $t05666156742._2
15491554 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15501555 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15511556 then (state ++ refreshKLpActions)
15521557 else throw("Strict value is not equal to itself.")
15531558 }
15541559 else throw("Strict value is not equal to itself.")
15551560 }
15561561 else throw("Strict value is not equal to itself.")
15571562 }
15581563 else throw("Strict value is not equal to itself.")
15591564 }
15601565 else throw("Strict value is not equal to itself.")
15611566 }
15621567 else throw("Strict value is not equal to itself.")
15631568 }
15641569
15651570
15661571
15671572 @Callable(i)
15681573 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15691574 let isGetDisabled = if (isGlobalShutdown())
15701575 then true
15711576 else (cfgPoolStatus == PoolShutdown)
15721577 let checks = [if (!(isGetDisabled))
15731578 then true
15741579 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15751580 then true
15761581 else throw("no payments are expected")]
15771582 if ((checks == checks))
15781583 then {
15791584 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15801585 if ((currentKLp == currentKLp))
15811586 then {
15821587 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15831588 if ((unstakeInv == unstakeInv))
15841589 then {
15851590 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15861591 let outAmAmt = res._1
15871592 let outPrAmt = res._2
15881593 let state = res._10
15891594 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15901595 then true
15911596 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15921597 then true
15931598 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15941599 if ((checkAmounts == checkAmounts))
15951600 then {
15961601 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15971602 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15981603 then {
1599- let $t05798758068 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1600- let refreshKLpActions = $t05798758068._1
1601- let updatedKLp = $t05798758068._2
1604+ let $t05803758118 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1605+ let refreshKLpActions = $t05803758118._1
1606+ let updatedKLp = $t05803758118._2
16021607 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
16031608 if ((isUpdatedKLpValid == isUpdatedKLpValid))
16041609 then (state ++ refreshKLpActions)
16051610 else throw("Strict value is not equal to itself.")
16061611 }
16071612 else throw("Strict value is not equal to itself.")
16081613 }
16091614 else throw("Strict value is not equal to itself.")
16101615 }
16111616 else throw("Strict value is not equal to itself.")
16121617 }
16131618 else throw("Strict value is not equal to itself.")
16141619 }
16151620 else throw("Strict value is not equal to itself.")
16161621 }
16171622
16181623
16191624
16201625 @Callable(i)
16211626 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
16221627 then throw("permissions denied")
16231628 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
16241629
16251630
16261631
16271632 @Callable(i)
16281633 func refreshKLp () = {
16291634 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
16301635 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
16311636 then unit
16321637 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
16331638 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
16341639 then {
16351640 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1636- let $t05925559319 = refreshKLpInternal(0, 0, 0)
1637- let kLpUpdateActions = $t05925559319._1
1638- let updatedKLp = $t05925559319._2
1641+ let $t05930559369 = refreshKLpInternal(0, 0, 0)
1642+ let kLpUpdateActions = $t05930559369._1
1643+ let updatedKLp = $t05930559369._2
16391644 let actions = if ((kLp != updatedKLp))
16401645 then kLpUpdateActions
16411646 else throwErr("nothing to refresh")
16421647 $Tuple2(actions, toString(updatedKLp))
16431648 }
16441649 else throw("Strict value is not equal to itself.")
16451650 }
16461651
16471652
16481653
16491654 @Callable(i)
16501655 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
16511656
16521657
16531658
16541659 @Callable(i)
16551660 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16561661
16571662
16581663
16591664 @Callable(i)
16601665 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16611666 let prices = calcPrices(amAmt, prAmt, lpAmt)
16621667 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
16631668 }
16641669
16651670
16661671
16671672 @Callable(i)
16681673 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
16691674
16701675
16711676
16721677 @Callable(i)
16731678 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
16741679
16751680
16761681
16771682 @Callable(i)
16781683 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
16791684
16801685
16811686
16821687 @Callable(i)
16831688 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
16841689
16851690
16861691
16871692 @Callable(i)
16881693 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
16891694 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
16901695 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
16911696 }
16921697
16931698
16941699
16951700 @Callable(i)
16961701 func statsREADONLY () = {
16971702 let cfg = getPoolConfig()
16981703 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16991704 let amtAssetId = cfg[idxAmtAssetId]
17001705 let priceAssetId = cfg[idxPriceAssetId]
17011706 let iAmtAssetId = cfg[idxIAmtAssetId]
17021707 let iPriceAssetId = cfg[idxIPriceAssetId]
17031708 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17041709 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17051710 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17061711 let accAmtAssetBalance = getAccBalance(amtAssetId)
17071712 let accPriceAssetBalance = getAccBalance(priceAssetId)
17081713 let pricesList = if ((poolLPBalance == 0))
17091714 then [zeroBigInt, zeroBigInt, zeroBigInt]
17101715 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
17111716 let curPrice = 0
17121717 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
17131718 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
17141719 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
17151720 $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))
17161721 }
17171722
17181723
17191724
17201725 @Callable(i)
17211726 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
17221727 let cfg = getPoolConfig()
17231728 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17241729 let amAssetIdStr = cfg[idxAmtAssetId]
17251730 let amAssetId = fromBase58String(amAssetIdStr)
17261731 let prAssetIdStr = cfg[idxPriceAssetId]
17271732 let prAssetId = fromBase58String(prAssetIdStr)
17281733 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17291734 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17301735 let poolStatus = cfg[idxPoolStatus]
17311736 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17321737 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
17331738 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
17341739 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
17351740 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
17361741 let curPriceX18 = if ((poolLPBalance == 0))
17371742 then zeroBigInt
17381743 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
17391744 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
17401745 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
17411746 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
17421747 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17431748 let calcLpAmt = estPut._1
17441749 let curPriceCalc = estPut._3
17451750 let amBalance = estPut._4
17461751 let prBalance = estPut._5
17471752 let lpEmission = estPut._6
17481753 $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))
17491754 }
17501755
17511756
17521757
17531758 @Callable(i)
17541759 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
17551760 let cfg = getPoolConfig()
17561761 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17571762 let amAssetIdStr = cfg[idxAmtAssetId]
17581763 let amAssetId = fromBase58String(amAssetIdStr)
17591764 let prAssetIdStr = cfg[idxPriceAssetId]
17601765 let prAssetId = fromBase58String(prAssetIdStr)
17611766 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17621767 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17631768 let poolStatus = cfg[idxPoolStatus]
17641769 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17651770 let amBalanceRaw = getAccBalance(amAssetIdStr)
17661771 let prBalanceRaw = getAccBalance(prAssetIdStr)
17671772 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
17681773 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
17691774 let curPriceX18 = if ((poolLPBalance == 0))
17701775 then zeroBigInt
17711776 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
17721777 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
17731778 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
17741779 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
17751780 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17761781 let calcLpAmt = estPut._1
17771782 let curPriceCalc = estPut._3
17781783 let amBalance = estPut._4
17791784 let prBalance = estPut._5
17801785 let lpEmission = estPut._6
17811786 $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))
17821787 }
17831788
17841789
17851790
17861791 @Callable(i)
17871792 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
17881793 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
17891794 let outAmAmt = res._1
17901795 let outPrAmt = res._2
17911796 let amBalance = res._5
17921797 let prBalance = res._6
17931798 let lpEmission = res._7
17941799 let curPrice = res._8
17951800 let poolStatus = parseIntValue(res._9)
17961801 $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))
17971802 }
17981803
17991804
18001805 @Verifier(tx)
18011806 func verify () = {
18021807 let targetPublicKey = match managerPublicKeyOrUnit() {
18031808 case pk: ByteVector =>
18041809 pk
18051810 case _: Unit =>
18061811 tx.senderPublicKey
18071812 case _ =>
18081813 throw("Match error")
18091814 }
18101815 match tx {
18111816 case order: Order =>
18121817 let matcherPub = getMatcherPubOrFail()
1813- let $t06798168050 = validateMatcherOrderAllowed(order)
1814- let orderValid = $t06798168050._1
1815- let orderValidInfo = $t06798168050._2
1818+ let $t06803168100 = validateMatcherOrderAllowed(order)
1819+ let orderValid = $t06803168100._1
1820+ let orderValidInfo = $t06803168100._2
18161821 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
18171822 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
18181823 if (if (if (orderValid)
18191824 then senderValid
18201825 else false)
18211826 then matcherValid
18221827 else false)
18231828 then true
18241829 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
18251830 case s: SetScriptTransaction =>
18261831 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
18271832 then true
18281833 else {
18291834 let newHash = blake2b256(value(s.script))
18301835 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
18311836 let currentHash = scriptHash(this)
18321837 if ((allowedHash == newHash))
18331838 then (currentHash != newHash)
18341839 else false
18351840 }
18361841 case _ =>
18371842 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
18381843 }
18391844 }
18401845

github/deemru/w8io/026f985 
213.72 ms