tx · HHwHKXRVF9XTaqcSE6d27XvcYyitdzxd6EtNsqqGg6Qj

3MpaDTfGahKAdXB9PeznNThKz6Nw1G2gxJB:  -0.03500000 Waves

2022.12.22 17:43 [2371632] smart account 3MpaDTfGahKAdXB9PeznNThKz6Nw1G2gxJB > SELF 0.00000000 Waves

{ "type": 13, "id": "HHwHKXRVF9XTaqcSE6d27XvcYyitdzxd6EtNsqqGg6Qj", "fee": 3500000, "feeAssetId": null, "timestamp": 1671720205915, "version": 1, "sender": "3MpaDTfGahKAdXB9PeznNThKz6Nw1G2gxJB", "senderPublicKey": "8xq2GREVKUe7SKE2XzJzQnB97tmj2C3rmEhTseHdpgXM", "proofs": [ "68iesiHUTUdyPGZbxLh2qTLDPqhWRYC3XPDLiU1NAUcg1jGJea6qadbhCm4DHQxA5jePVwe5znTdyqn7didpZBF" ], "script": "base64:BgKdLQgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXNzZX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BAEJAQV2YWx1ZQEJAJ0IAgUCYUwJAQJheQAEAmdICQDxBwEFBHRoaXMDAwkAAAIFAmdHBQJnRgkBAiE9AgUCZ0gFAmdGBwYJAPQDAwgFAmdCCWJvZHlCeXRlcwkAkQMCCAUCZ0IGcHJvb2ZzAAAFAmdECQD0AwMIBQJnQglib2R5Qnl0ZXMJAJEDAggFAmdCBnByb29mcwAABQJnRAPwMbs=", "chainId": 84, "height": 2371632, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GdoVkJn391V4TJLGRSnaBEf1Nqcqza1R8vB3eovHecFg Next: HF57ieZXA31AnTDg3oMtjzwJ9akJYspspZufrDuTYf2w Diff:
OldNewDifferences
11121112 else if ((noLessThenPriceAsset > outPrAmt))
11131113 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
11141114 else {
1115- let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
1116- let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
1117- if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1115+ let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
1116+ if ((currentKLp == currentKLp))
11181117 then {
1119- let $t04325343334 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1120- let refreshKLpActions = $t04325343334._1
1121- let updatedKLp = $t04325343334._2
1122- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1123- if ((isUpdatedKLpValid == isUpdatedKLpValid))
1124- then (state ++ refreshKLpActions)
1118+ let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
1119+ if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1120+ then {
1121+ let $t04325143332 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1122+ let refreshKLpActions = $t04325143332._1
1123+ let updatedKLp = $t04325143332._2
1124+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1125+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
1126+ then (state ++ refreshKLpActions)
1127+ else throw("Strict value is not equal to itself.")
1128+ }
11251129 else throw("Strict value is not equal to itself.")
11261130 }
11271131 else throw("Strict value is not equal to itself.")
11401144 let cfg = getPoolConfig()
11411145 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11421146 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
1143- let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
1144- if ((unstakeInv == unstakeInv))
1147+ if ((currentKLp == currentKLp))
11451148 then {
1146- let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
1147- let outAmAmt = res._1
1148- let outPrAmt = res._2
1149- let poolStatus = parseIntValue(res._9)
1150- let state = res._10
1151- let checkPoolStatus = if (if (isGlobalShutdown())
1152- then true
1153- else (poolStatus == PoolShutdown))
1154- then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
1155- else true
1156- if ((checkPoolStatus == checkPoolStatus))
1149+ let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
1150+ if ((unstakeInv == unstakeInv))
11571151 then {
1158- let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
1159- if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1152+ let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
1153+ let outAmAmt = res._1
1154+ let outPrAmt = res._2
1155+ let poolStatus = parseIntValue(res._9)
1156+ let state = res._10
1157+ let checkPoolStatus = if (if (isGlobalShutdown())
1158+ then true
1159+ else (poolStatus == PoolShutdown))
1160+ then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
1161+ else true
1162+ if ((checkPoolStatus == checkPoolStatus))
11601163 then {
1161- let $t04445744538 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1162- let refreshKLpActions = $t04445744538._1
1163- let updatedKLp = $t04445744538._2
1164- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1165- if ((isUpdatedKLpValid == isUpdatedKLpValid))
1166- then (state ++ refreshKLpActions)
1164+ let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
1165+ if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1166+ then {
1167+ let $t04445844539 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1168+ let refreshKLpActions = $t04445844539._1
1169+ let updatedKLp = $t04445844539._2
1170+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1171+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
1172+ then (state ++ refreshKLpActions)
1173+ else throw("Strict value is not equal to itself.")
1174+ }
11671175 else throw("Strict value is not equal to itself.")
11681176 }
11691177 else throw("Strict value is not equal to itself.")
11901198 if ((checks == checks))
11911199 then {
11921200 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
1193- let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
1194- if ((unstakeInv == unstakeInv))
1201+ if ((currentKLp == currentKLp))
11951202 then {
1196- let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
1197- let outAmAmt = res._1
1198- let outPrAmt = res._2
1199- let state = res._10
1200- let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
1201- then true
1202- else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
1203- then true
1204- else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
1205- if ((checkAmounts == checkAmounts))
1203+ let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
1204+ if ((unstakeInv == unstakeInv))
12061205 then {
1207- let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
1208- if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1206+ let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
1207+ let outAmAmt = res._1
1208+ let outPrAmt = res._2
1209+ let state = res._10
1210+ let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
1211+ then true
1212+ else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
1213+ then true
1214+ else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
1215+ if ((checkAmounts == checkAmounts))
12091216 then {
1210- let $t04583045911 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1211- let refreshKLpActions = $t04583045911._1
1212- let updatedKLp = $t04583045911._2
1213- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1214- if ((isUpdatedKLpValid == isUpdatedKLpValid))
1215- then (state ++ refreshKLpActions)
1217+ let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
1218+ if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1219+ then {
1220+ let $t04583445915 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1221+ let refreshKLpActions = $t04583445915._1
1222+ let updatedKLp = $t04583445915._2
1223+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1224+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
1225+ then (state ++ refreshKLpActions)
1226+ else throw("Strict value is not equal to itself.")
1227+ }
12161228 else throw("Strict value is not equal to itself.")
12171229 }
12181230 else throw("Strict value is not equal to itself.")
12421254 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12431255 then {
12441256 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1245- let $t04709847162 = refreshKLpInternal(0, 0, 0)
1246- let kLpUpdateActions = $t04709847162._1
1247- let updatedKLp = $t04709847162._2
1257+ let $t04710247166 = refreshKLpInternal(0, 0, 0)
1258+ let kLpUpdateActions = $t04710247166._1
1259+ let updatedKLp = $t04710247166._2
12481260 let actions = if ((kLp != updatedKLp))
12491261 then kLpUpdateActions
12501262 else throwErr("nothing to refresh")
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 fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6666
6767
6868 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
6969
7070
7171 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7272
7373
7474 func abs (val) = if ((0 > val))
7575 then -(val)
7676 else val
7777
7878
7979 func absBigInt (val) = if ((zeroBigInt > val))
8080 then -(val)
8181 else val
8282
8383
8484 func fc () = "%s__factoryContract"
8585
8686
8787 func mpk () = "%s__managerPublicKey"
8888
8989
9090 func pmpk () = "%s__pendingManagerPublicKey"
9191
9292
9393 func pl () = "%s%s__price__last"
9494
9595
9696 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9797
9898
9999 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
100100
101101
102102 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
103103
104104
105105 func aa () = "%s__amountAsset"
106106
107107
108108 func pa () = "%s__priceAsset"
109109
110110
111111 let keyFee = "%s__fee"
112112
113113 let feeDefault = fraction(10, scale8, 10000)
114114
115115 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
116116
117117 let keyKLp = makeString(["%s", "kLp"], SEP)
118118
119119 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
120120
121121 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
122122
123123 let kLpRefreshDelayDefault = 30
124124
125125 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
126126
127127 func keyFactoryConfig () = "%s__factoryConfig"
128128
129129
130130 func keyMatcherPub () = "%s%s__matcher__publicKey"
131131
132132
133133 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
134134
135135
136136 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
137137
138138
139139 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
140140
141141
142142 func keyAllPoolsShutdown () = "%s__shutdown"
143143
144144
145145 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
146146
147147
148148 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
149149
150150
151151 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
152152
153153 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
154154
155155
156156 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157157
158158
159159 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
160160
161161
162162 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
163163
164164
165165 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
166166
167167
168168 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
169169
170170 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
171171
172172 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
173173
174174
175175 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
176176
177177
178178 func getPoolConfig () = {
179179 let amtAsset = getStringOrFail(this, aa())
180180 let priceAsset = getStringOrFail(this, pa())
181181 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
182182 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
183183 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
184184 }
185185
186186
187187 func parseAssetId (input) = if ((input == wavesString))
188188 then unit
189189 else fromBase58String(input)
190190
191191
192192 func assetIdToString (input) = if ((input == unit))
193193 then wavesString
194194 else toBase58String(value(input))
195195
196196
197197 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]))
198198
199199
200200 let poolConfigParsed = parsePoolConfig(getPoolConfig())
201201
202202 let $t080588224 = poolConfigParsed
203203
204204 let cfgPoolAddress = $t080588224._1
205205
206206 let cfgPoolStatus = $t080588224._2
207207
208208 let cfgLpAssetId = $t080588224._3
209209
210210 let cfgAmountAssetId = $t080588224._4
211211
212212 let cfgPriceAssetId = $t080588224._5
213213
214214 let cfgAmountAssetDecimals = $t080588224._6
215215
216216 let cfgPriceAssetDecimals = $t080588224._7
217217
218218 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
219219
220220
221221 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
222222
223223 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
224224
225225 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)
226226
227227
228228 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)
229229
230230
231231 func getAccBalance (assetId) = if ((assetId == "WAVES"))
232232 then wavesBalance(this).available
233233 else assetBalance(this, fromBase58String(assetId))
234234
235235
236236 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
237237
238238
239239 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
240240
241241
242242 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
243243 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
244244 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
245245 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
246246 }
247247
248248
249249 func calcPrices (amAmt,prAmt,lpAmt) = {
250250 let cfg = getPoolConfig()
251251 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
252252 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
253253 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
254254 let amAmtX18 = toX18(amAmt, amtAssetDcm)
255255 let prAmtX18 = toX18(prAmt, priceAssetDcm)
256256 let lpAmtX18 = toX18(lpAmt, scale8)
257257 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
258258 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
259259 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
260260 }
261261
262262
263263 func calculatePrices (amAmt,prAmt,lpAmt) = {
264264 let prices = calcPrices(amAmt, prAmt, lpAmt)
265265 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
266266 }
267267
268268
269269 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
270270 let cfg = getPoolConfig()
271271 let lpAssetId = cfg[idxPoolLPAssetId]
272272 let amAssetId = cfg[idxAmtAssetId]
273273 let prAssetId = cfg[idxPriceAssetId]
274274 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
275275 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
276276 let poolStatus = cfg[idxPoolStatus]
277277 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
278278 if ((lpAssetId != pmtAssetId))
279279 then throw("Invalid asset passed.")
280280 else {
281281 let amBalance = getAccBalance(amAssetId)
282282 let amBalanceX18 = toX18(amBalance, amAssetDcm)
283283 let prBalance = getAccBalance(prAssetId)
284284 let prBalanceX18 = toX18(prBalance, prAssetDcm)
285285 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
286286 let curPrice = fromX18(curPriceX18, scale8)
287287 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
288288 let lpEmissionX18 = toX18(lpEmission, scale8)
289289 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
290290 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
291291 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
292292 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
293293 let state = if ((txId58 == ""))
294294 then nil
295295 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
296296 then unit
297297 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
298298 then unit
299299 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)]
300300 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
301301 }
302302 }
303303
304304
305305 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
306306 let cfg = getPoolConfig()
307307 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
308308 let amAssetIdStr = cfg[idxAmtAssetId]
309309 let prAssetIdStr = cfg[idxPriceAssetId]
310310 let iAmtAssetId = cfg[idxIAmtAssetId]
311311 let iPriceAssetId = cfg[idxIPriceAssetId]
312312 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
313313 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
314314 let poolStatus = cfg[idxPoolStatus]
315315 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
316316 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
317317 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
318318 if (if ((amAssetIdStr != inAmAssetIdStr))
319319 then true
320320 else (prAssetIdStr != inPrAssetIdStr))
321321 then throw("Invalid amt or price asset passed.")
322322 else {
323323 let amBalance = if (isEvaluate)
324324 then getAccBalance(amAssetIdStr)
325325 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
326326 let prBalance = if (isEvaluate)
327327 then getAccBalance(prAssetIdStr)
328328 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
329329 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
330330 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
331331 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
332332 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
333333 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
334334 let res = if ((lpEmission == 0))
335335 then {
336336 let curPriceX18 = zeroBigInt
337337 let slippageX18 = zeroBigInt
338338 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
339339 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
340340 }
341341 else {
342342 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
343343 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
344344 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
345345 if (if ((curPriceX18 != zeroBigInt))
346346 then (slippageX18 > slippageToleranceX18)
347347 else false)
348348 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
349349 else {
350350 let lpEmissionX18 = toX18(lpEmission, scale8)
351351 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
352352 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
353353 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
354354 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
355355 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
356356 let expAmtAssetAmtX18 = expectedAmts._1
357357 let expPriceAssetAmtX18 = expectedAmts._2
358358 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
359359 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
360360 }
361361 }
362362 let calcLpAmt = res._1
363363 let calcAmAssetPmt = res._2
364364 let calcPrAssetPmt = res._3
365365 let curPrice = fromX18(res._4, scale8)
366366 let slippageCalc = fromX18(res._5, scale8)
367367 if ((0 >= calcLpAmt))
368368 then throw("Invalid calculations. LP calculated is less than zero.")
369369 else {
370370 let emitLpAmt = if (!(emitLp))
371371 then 0
372372 else calcLpAmt
373373 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
374374 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
375375 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))]
376376 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
377377 }
378378 }
379379 }
380380
381381
382382 func calcKLp (amountBalance,priceBalance,lpEmission) = {
383383 let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
384384 if ((lpEmission == big0))
385385 then big0
386386 else updatedKLp
387387 }
388388
389389
390390 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
391391 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
392392 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
393393 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
394394 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
395395 currentKLp
396396 }
397397
398398
399399 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
400400 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
401401 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
402402 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
403403 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
404404 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
405405 $Tuple2(actions, updatedKLp)
406406 }
407407
408408
409409 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
410410 then true
411411 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
412412
413413
414414 func validateMatcherOrderAllowed (order) = {
415415 let amountAssetAmount = order.amount
416416 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
417417 let $t02080121013 = if ((order.orderType == Buy))
418418 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
419419 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
420420 let amountAssetBalanceDelta = $t02080121013._1
421421 let priceAssetBalanceDelta = $t02080121013._2
422422 if (if (if (isGlobalShutdown())
423423 then true
424424 else (cfgPoolStatus == PoolMatcherDisabled))
425425 then true
426426 else (cfgPoolStatus == PoolShutdown))
427427 then throw("Exchange operations disabled")
428428 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
429429 then true
430430 else (order.assetPair.priceAsset != cfgPriceAssetId))
431431 then throw("Wrong order assets.")
432432 else {
433433 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
434434 let $t02148421584 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
435435 let unusedActions = $t02148421584._1
436436 let kLpNew = $t02148421584._2
437437 let isOrderValid = (kLpNew >= kLp)
438438 isOrderValid
439439 }
440440 }
441441
442442
443443 func commonGet (i) = if ((size(i.payments) != 1))
444444 then throw("exactly 1 payment is expected")
445445 else {
446446 let pmt = value(i.payments[0])
447447 let pmtAssetId = value(pmt.assetId)
448448 let pmtAmt = pmt.amount
449449 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
450450 let outAmAmt = res._1
451451 let outPrAmt = res._2
452452 let poolStatus = parseIntValue(res._9)
453453 let state = res._10
454454 if (if (isGlobalShutdown())
455455 then true
456456 else (poolStatus == PoolShutdown))
457457 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
458458 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
459459 }
460460
461461
462462 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
463463 then throw("exactly 2 payments are expected")
464464 else {
465465 let amAssetPmt = value(i.payments[0])
466466 let prAssetPmt = value(i.payments[1])
467467 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
468468 let poolStatus = parseIntValue(estPut._8)
469469 if (if (if (isGlobalShutdown())
470470 then true
471471 else (poolStatus == PoolPutDisabled))
472472 then true
473473 else (poolStatus == PoolShutdown))
474474 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
475475 else estPut
476476 }
477477
478478
479479 func emit (amount) = {
480480 let emitInv = invoke(factoryContract, "emit", [amount], nil)
481481 if ((emitInv == emitInv))
482482 then {
483483 let emitInvLegacy = match emitInv {
484484 case legacyFactoryContract: Address =>
485485 invoke(legacyFactoryContract, "emit", [amount], nil)
486486 case _ =>
487487 unit
488488 }
489489 if ((emitInvLegacy == emitInvLegacy))
490490 then amount
491491 else throw("Strict value is not equal to itself.")
492492 }
493493 else throw("Strict value is not equal to itself.")
494494 }
495495
496496
497497 func takeFee (amount) = {
498498 let feeAmount = fraction(amount, fee, scale8)
499499 $Tuple2((amount - feeAmount), feeAmount)
500500 }
501501
502502
503503 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
504504 let isEval = (txId == unit)
505505 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
506506 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
507507 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
508508 then true
509509 else if ((paymentAssetId == cfgPriceAssetId))
510510 then false
511511 else throwErr("invalid asset")
512512 let $t02426924562 = if (isEval)
513513 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
514514 else if (paymentInAmountAsset)
515515 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
516516 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
517517 let amountBalanceOld = $t02426924562._1
518518 let priceBalanceOld = $t02426924562._2
519519 let $t02456624715 = if (paymentInAmountAsset)
520520 then $Tuple2(paymentAmountRaw, 0)
521521 else $Tuple2(0, paymentAmountRaw)
522522 let amountAssetAmountRaw = $t02456624715._1
523523 let priceAssetAmountRaw = $t02456624715._2
524524 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
525525 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
526526 let $t02483724896 = takeFee(paymentAmountRaw)
527527 let paymentAmount = $t02483724896._1
528528 let feeAmount = $t02483724896._2
529529 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
530530 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
531531 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
532532 let priceNew = fromX18(priceNewX18, scale8)
533533 let paymentBalance = if (paymentInAmountAsset)
534534 then amountBalanceOld
535535 else priceBalanceOld
536536 let paymentBalanceBigInt = toBigInt(paymentBalance)
537537 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
538538 let chechSupply = if ((supplyBigInt > big0))
539539 then true
540540 else throwErr("initial deposit requires all coins")
541541 if ((chechSupply == chechSupply))
542542 then {
543543 let depositBigInt = toBigInt(paymentAmount)
544544 let issueAmount = max([0, fromX18Round(fraction(supplyBigInt, (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18), scale18), scale8, FLOOR)])
545545 let commonState = if (isEval)
546546 then nil
547547 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))]
548548 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
549549 let priceOld = fromX18(priceOldX18, scale8)
550550 let loss = {
551551 let $t02639726564 = if (paymentInAmountAsset)
552552 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
553553 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
554554 let amount = $t02639726564._1
555555 let balance = $t02639726564._2
556556 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
557557 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
558558 }
559559 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
560560 }
561561 else throw("Strict value is not equal to itself.")
562562 }
563563
564564
565565 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
566566 let isEval = (txId == unit)
567567 let cfg = getPoolConfig()
568568 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
569569 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
570570 let checks = [if ((paymentAssetId == cfgLpAssetId))
571571 then true
572572 else throwErr("invalid lp asset")]
573573 if ((checks == checks))
574574 then {
575575 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
576576 then true
577577 else if ((outAssetId == cfgPriceAssetId))
578578 then false
579579 else throwErr("invalid asset")
580580 let balanceBigInt = if (outInAmountAsset)
581581 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
582582 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
583583 let outInAmountAssetDecimals = if (outInAmountAsset)
584584 then amtAssetDcm
585585 else priceAssetDcm
586586 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
587587 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
588588 let outBalance = if (outInAmountAsset)
589589 then amBalanceOld
590590 else prBalanceOld
591591 let outBalanceBigInt = toBigInt(outBalance)
592592 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
593593 let redeemedBigInt = toBigInt(paymentAmount)
594594 let amountRaw = max([0, fromX18Round(fraction(balanceBigInt, (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN)), scale18), outInAmountAssetDecimals, FLOOR)])
595595 let $t02846528515 = takeFee(amountRaw)
596596 let totalAmount = $t02846528515._1
597597 let feeAmount = $t02846528515._2
598598 let $t02851928745 = if (outInAmountAsset)
599599 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
600600 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
601601 let outAmAmount = $t02851928745._1
602602 let outPrAmount = $t02851928745._2
603603 let amBalanceNew = $t02851928745._3
604604 let prBalanceNew = $t02851928745._4
605605 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
606606 let priceNew = fromX18(priceNewX18, scale8)
607607 let commonState = if (isEval)
608608 then nil
609609 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)]
610610 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
611611 let priceOld = fromX18(priceOldX18, scale8)
612612 let loss = {
613613 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
614614 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
615615 }
616616 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
617617 }
618618 else throw("Strict value is not equal to itself.")
619619 }
620620
621621
622622 func managerPublicKeyOrUnit () = match getString(mpk()) {
623623 case s: String =>
624624 fromBase58String(s)
625625 case _: Unit =>
626626 unit
627627 case _ =>
628628 throw("Match error")
629629 }
630630
631631
632632 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
633633 case s: String =>
634634 fromBase58String(s)
635635 case _: Unit =>
636636 unit
637637 case _ =>
638638 throw("Match error")
639639 }
640640
641641
642642 func isManager (i) = match managerPublicKeyOrUnit() {
643643 case pk: ByteVector =>
644644 (i.callerPublicKey == pk)
645645 case _: Unit =>
646646 (i.caller == this)
647647 case _ =>
648648 throw("Match error")
649649 }
650650
651651
652652 func mustManager (i) = {
653653 let pd = throw("Permission denied")
654654 match managerPublicKeyOrUnit() {
655655 case pk: ByteVector =>
656656 if ((i.callerPublicKey == pk))
657657 then true
658658 else pd
659659 case _: Unit =>
660660 if ((i.caller == this))
661661 then true
662662 else pd
663663 case _ =>
664664 throw("Match error")
665665 }
666666 }
667667
668668
669669 @Callable(i)
670670 func setManager (pendingManagerPublicKey) = {
671671 let checkCaller = mustManager(i)
672672 if ((checkCaller == checkCaller))
673673 then {
674674 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
675675 if ((checkManagerPublicKey == checkManagerPublicKey))
676676 then [StringEntry(pmpk(), pendingManagerPublicKey)]
677677 else throw("Strict value is not equal to itself.")
678678 }
679679 else throw("Strict value is not equal to itself.")
680680 }
681681
682682
683683
684684 @Callable(i)
685685 func confirmManager () = {
686686 let pm = pendingManagerPublicKeyOrUnit()
687687 let hasPM = if (isDefined(pm))
688688 then true
689689 else throw("No pending manager")
690690 if ((hasPM == hasPM))
691691 then {
692692 let checkPM = if ((i.callerPublicKey == value(pm)))
693693 then true
694694 else throw("You are not pending manager")
695695 if ((checkPM == checkPM))
696696 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
697697 else throw("Strict value is not equal to itself.")
698698 }
699699 else throw("Strict value is not equal to itself.")
700700 }
701701
702702
703703
704704 @Callable(i)
705705 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
706706 then throw("Invalid slippageTolerance passed")
707707 else {
708708 let estPut = commonPut(i, slippageTolerance, true)
709709 let emitLpAmt = estPut._2
710710 let lpAssetId = estPut._7
711711 let state = estPut._9
712712 let amDiff = estPut._10
713713 let prDiff = estPut._11
714714 let amId = estPut._12
715715 let prId = estPut._13
716716 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
717717 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
718718 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
719719 if ((currentKLp == currentKLp))
720720 then {
721721 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
722722 if ((emitInv == emitInv))
723723 then {
724724 let emitInvLegacy = match emitInv {
725725 case legacyFactoryContract: Address =>
726726 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
727727 case _ =>
728728 unit
729729 }
730730 if ((emitInvLegacy == emitInvLegacy))
731731 then {
732732 let slippageAInv = if ((amDiff > 0))
733733 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
734734 else nil
735735 if ((slippageAInv == slippageAInv))
736736 then {
737737 let slippagePInv = if ((prDiff > 0))
738738 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
739739 else nil
740740 if ((slippagePInv == slippagePInv))
741741 then {
742742 let lpTransfer = if (shouldAutoStake)
743743 then {
744744 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
745745 if ((slpStakeInv == slpStakeInv))
746746 then nil
747747 else throw("Strict value is not equal to itself.")
748748 }
749749 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
750750 let $t03327333735 = refreshKLpInternal(0, 0, 0)
751751 if (($t03327333735 == $t03327333735))
752752 then {
753753 let updatedKLp = $t03327333735._2
754754 let refreshKLpActions = $t03327333735._1
755755 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
756756 if ((isUpdatedKLpValid == isUpdatedKLpValid))
757757 then ((state ++ lpTransfer) ++ refreshKLpActions)
758758 else throw("Strict value is not equal to itself.")
759759 }
760760 else throw("Strict value is not equal to itself.")
761761 }
762762 else throw("Strict value is not equal to itself.")
763763 }
764764 else throw("Strict value is not equal to itself.")
765765 }
766766 else throw("Strict value is not equal to itself.")
767767 }
768768 else throw("Strict value is not equal to itself.")
769769 }
770770 else throw("Strict value is not equal to itself.")
771771 }
772772
773773
774774
775775 @Callable(i)
776776 func putForFree (maxSlippage) = if ((0 > maxSlippage))
777777 then throw("Invalid value passed")
778778 else {
779779 let estPut = commonPut(i, maxSlippage, false)
780780 let state = estPut._9
781781 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
782782 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
783783 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
784784 if ((currentKLp == currentKLp))
785785 then {
786786 let $t03429734362 = refreshKLpInternal(0, 0, 0)
787787 let refreshKLpActions = $t03429734362._1
788788 let updatedKLp = $t03429734362._2
789789 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
790790 if ((isUpdatedKLpValid == isUpdatedKLpValid))
791791 then (state ++ refreshKLpActions)
792792 else throw("Strict value is not equal to itself.")
793793 }
794794 else throw("Strict value is not equal to itself.")
795795 }
796796
797797
798798
799799 @Callable(i)
800800 func putOneTkn (minOutAmount,autoStake) = {
801801 let isPoolOneTokenOperationsDisabled = {
802802 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
803803 if ($isInstanceOf(@, "Boolean"))
804804 then @
805805 else throw(($getType(@) + " couldn't be cast to Boolean"))
806806 }
807807 let isPutDisabled = if (if (if (isGlobalShutdown())
808808 then true
809809 else (cfgPoolStatus == PoolPutDisabled))
810810 then true
811811 else (cfgPoolStatus == PoolShutdown))
812812 then true
813813 else isPoolOneTokenOperationsDisabled
814814 let checks = [if (if (!(isPutDisabled))
815815 then true
816816 else isManager(i))
817817 then true
818818 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
819819 then true
820820 else throwErr("exactly 1 payment are expected")]
821821 if ((checks == checks))
822822 then {
823823 let payment = i.payments[0]
824824 let paymentAssetId = payment.assetId
825825 let paymentAmountRaw = payment.amount
826826 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
827827 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
828828 else if ((paymentAssetId == cfgPriceAssetId))
829829 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
830830 else throwErr("payment asset is not supported")
831831 if ((currentKLp == currentKLp))
832832 then {
833833 let userAddress = i.caller
834834 let txId = i.transactionId
835835 let $t03555035702 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836836 if (($t03555035702 == $t03555035702))
837837 then {
838838 let paymentInAmountAsset = $t03555035702._5
839839 let bonus = $t03555035702._4
840840 let feeAmount = $t03555035702._3
841841 let commonState = $t03555035702._2
842842 let emitAmountEstimated = $t03555035702._1
843843 let emitAmount = if (if ((minOutAmount > 0))
844844 then (minOutAmount > emitAmountEstimated)
845845 else false)
846846 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
847847 else emitAmountEstimated
848848 let emitInv = emit(emitAmount)
849849 if ((emitInv == emitInv))
850850 then {
851851 let lpTransfer = if (autoStake)
852852 then {
853853 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
854854 if ((stakeInv == stakeInv))
855855 then nil
856856 else throw("Strict value is not equal to itself.")
857857 }
858858 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
859859 let sendFee = if ((feeAmount > 0))
860860 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
861861 else nil
862862 let $t03628836485 = if ((this == feeCollectorAddress))
863863 then $Tuple2(0, 0)
864864 else if (paymentInAmountAsset)
865865 then $Tuple2(-(feeAmount), 0)
866866 else $Tuple2(0, -(feeAmount))
867867 let amountAssetBalanceDelta = $t03628836485._1
868868 let priceAssetBalanceDelta = $t03628836485._2
869869 let $t03648836596 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870870 let refreshKLpActions = $t03648836596._1
871871 let updatedKLp = $t03648836596._2
872872 let kLp = value(getString(keyKLp))
873873 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
874874 if ((isUpdatedKLpValid == isUpdatedKLpValid))
875875 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
876876 else throw("Strict value is not equal to itself.")
877877 }
878878 else throw("Strict value is not equal to itself.")
879879 }
880880 else throw("Strict value is not equal to itself.")
881881 }
882882 else throw("Strict value is not equal to itself.")
883883 }
884884 else throw("Strict value is not equal to itself.")
885885 }
886886
887887
888888
889889 @Callable(i)
890890 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
891891 let $t03690237059 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892892 let emitAmountEstimated = $t03690237059._1
893893 let commonState = $t03690237059._2
894894 let feeAmount = $t03690237059._3
895895 let bonus = $t03690237059._4
896896 let paymentInAmountAsset = $t03690237059._5
897897 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
898898 }
899899
900900
901901
902902 @Callable(i)
903903 func getOneTkn (outAssetIdStr,minOutAmount) = {
904904 let isPoolOneTokenOperationsDisabled = {
905905 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
906906 if ($isInstanceOf(@, "Boolean"))
907907 then @
908908 else throw(($getType(@) + " couldn't be cast to Boolean"))
909909 }
910910 let isGetDisabled = if (if (isGlobalShutdown())
911911 then true
912912 else (cfgPoolStatus == PoolShutdown))
913913 then true
914914 else isPoolOneTokenOperationsDisabled
915915 let checks = [if (if (!(isGetDisabled))
916916 then true
917917 else isManager(i))
918918 then true
919919 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
920920 then true
921921 else throwErr("exactly 1 payment are expected")]
922922 if ((checks == checks))
923923 then {
924924 let outAssetId = parseAssetId(outAssetIdStr)
925925 let payment = i.payments[0]
926926 let paymentAssetId = payment.assetId
927927 let paymentAmount = payment.amount
928928 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
929929 if ((currentKLp == currentKLp))
930930 then {
931931 let userAddress = i.caller
932932 let txId = i.transactionId
933933 let $t03794438097 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934934 if (($t03794438097 == $t03794438097))
935935 then {
936936 let outInAmountAsset = $t03794438097._5
937937 let bonus = $t03794438097._4
938938 let feeAmount = $t03794438097._3
939939 let commonState = $t03794438097._2
940940 let amountEstimated = $t03794438097._1
941941 let amount = if (if ((minOutAmount > 0))
942942 then (minOutAmount > amountEstimated)
943943 else false)
944944 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
945945 else amountEstimated
946946 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
947947 if ((burnInv == burnInv))
948948 then {
949949 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
950950 let sendFee = if ((feeAmount > 0))
951951 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
952952 else nil
953953 let $t03859738844 = {
954954 let feeAmountForCalc = if ((this == feeCollectorAddress))
955955 then 0
956956 else feeAmount
957957 if (outInAmountAsset)
958958 then $Tuple2(-((amount + feeAmountForCalc)), 0)
959959 else $Tuple2(0, -((amount + feeAmountForCalc)))
960960 }
961961 let amountAssetBalanceDelta = $t03859738844._1
962962 let priceAssetBalanceDelta = $t03859738844._2
963963 let $t03884738955 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964964 let refreshKLpActions = $t03884738955._1
965965 let updatedKLp = $t03884738955._2
966966 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
967967 if ((isUpdatedKLpValid == isUpdatedKLpValid))
968968 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
969969 else throw("Strict value is not equal to itself.")
970970 }
971971 else throw("Strict value is not equal to itself.")
972972 }
973973 else throw("Strict value is not equal to itself.")
974974 }
975975 else throw("Strict value is not equal to itself.")
976976 }
977977 else throw("Strict value is not equal to itself.")
978978 }
979979
980980
981981
982982 @Callable(i)
983983 func getOneTknREADONLY (outAssetId,paymentAmount) = {
984984 let $t03921239368 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985985 let amountEstimated = $t03921239368._1
986986 let commonState = $t03921239368._2
987987 let feeAmount = $t03921239368._3
988988 let bonus = $t03921239368._4
989989 let outInAmountAsset = $t03921239368._5
990990 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
991991 }
992992
993993
994994
995995 @Callable(i)
996996 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
997997 let isPoolOneTokenOperationsDisabled = {
998998 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
999999 if ($isInstanceOf(@, "Boolean"))
10001000 then @
10011001 else throw(($getType(@) + " couldn't be cast to Boolean"))
10021002 }
10031003 let isGetDisabled = if (if (isGlobalShutdown())
10041004 then true
10051005 else (cfgPoolStatus == PoolShutdown))
10061006 then true
10071007 else isPoolOneTokenOperationsDisabled
10081008 let checks = [if (if (!(isGetDisabled))
10091009 then true
10101010 else isManager(i))
10111011 then true
10121012 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
10131013 then true
10141014 else throwErr("no payments are expected")]
10151015 if ((checks == checks))
10161016 then {
10171017 let outAssetId = parseAssetId(outAssetIdStr)
10181018 let userAddress = i.caller
10191019 let txId = i.transactionId
10201020 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10211021 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10221022 if ((unstakeInv == unstakeInv))
10231023 then {
10241024 let $t04027040421 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
10251025 if (($t04027040421 == $t04027040421))
10261026 then {
10271027 let outInAmountAsset = $t04027040421._5
10281028 let bonus = $t04027040421._4
10291029 let feeAmount = $t04027040421._3
10301030 let commonState = $t04027040421._2
10311031 let amountEstimated = $t04027040421._1
10321032 let amount = if (if ((minOutAmount > 0))
10331033 then (minOutAmount > amountEstimated)
10341034 else false)
10351035 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10361036 else amountEstimated
10371037 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10381038 if ((burnInv == burnInv))
10391039 then {
10401040 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
10411041 let sendFee = if ((feeAmount > 0))
10421042 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10431043 else nil
10441044 let $t04091641163 = {
10451045 let feeAmountForCalc = if ((this == feeCollectorAddress))
10461046 then 0
10471047 else feeAmount
10481048 if (outInAmountAsset)
10491049 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10501050 else $Tuple2(0, -((amount + feeAmountForCalc)))
10511051 }
10521052 let amountAssetBalanceDelta = $t04091641163._1
10531053 let priceAssetBalanceDelta = $t04091641163._2
10541054 let $t04116641274 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
10551055 let refreshKLpActions = $t04116641274._1
10561056 let updatedKLp = $t04116641274._2
10571057 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10581058 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10591059 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10601060 else throw("Strict value is not equal to itself.")
10611061 }
10621062 else throw("Strict value is not equal to itself.")
10631063 }
10641064 else throw("Strict value is not equal to itself.")
10651065 }
10661066 else throw("Strict value is not equal to itself.")
10671067 }
10681068 else throw("Strict value is not equal to itself.")
10691069 }
10701070
10711071
10721072
10731073 @Callable(i)
10741074 func get () = {
10751075 let res = commonGet(i)
10761076 let outAmtAmt = res._1
10771077 let outPrAmt = res._2
10781078 let pmtAmt = res._3
10791079 let pmtAssetId = res._4
10801080 let state = res._5
10811081 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10821082 if ((currentKLp == currentKLp))
10831083 then {
10841084 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10851085 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10861086 then {
10871087 let $t04222042302 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
10881088 let refreshKLpActions = $t04222042302._1
10891089 let updatedKLp = $t04222042302._2
10901090 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10911091 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10921092 then (state ++ refreshKLpActions)
10931093 else throw("Strict value is not equal to itself.")
10941094 }
10951095 else throw("Strict value is not equal to itself.")
10961096 }
10971097 else throw("Strict value is not equal to itself.")
10981098 }
10991099
11001100
11011101
11021102 @Callable(i)
11031103 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
11041104 let res = commonGet(i)
11051105 let outAmAmt = res._1
11061106 let outPrAmt = res._2
11071107 let pmtAmt = res._3
11081108 let pmtAssetId = res._4
11091109 let state = res._5
11101110 if ((noLessThenAmtAsset > outAmAmt))
11111111 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
11121112 else if ((noLessThenPriceAsset > outPrAmt))
11131113 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
11141114 else {
1115- let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
1116- let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
1117- if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1115+ let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
1116+ if ((currentKLp == currentKLp))
11181117 then {
1119- let $t04325343334 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1120- let refreshKLpActions = $t04325343334._1
1121- let updatedKLp = $t04325343334._2
1122- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1123- if ((isUpdatedKLpValid == isUpdatedKLpValid))
1124- then (state ++ refreshKLpActions)
1118+ let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
1119+ if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1120+ then {
1121+ let $t04325143332 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1122+ let refreshKLpActions = $t04325143332._1
1123+ let updatedKLp = $t04325143332._2
1124+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1125+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
1126+ then (state ++ refreshKLpActions)
1127+ else throw("Strict value is not equal to itself.")
1128+ }
11251129 else throw("Strict value is not equal to itself.")
11261130 }
11271131 else throw("Strict value is not equal to itself.")
11281132 }
11291133 }
11301134
11311135
11321136
11331137 @Callable(i)
11341138 func unstakeAndGet (amount) = {
11351139 let checkPayments = if ((size(i.payments) != 0))
11361140 then throw("No payments are expected")
11371141 else true
11381142 if ((checkPayments == checkPayments))
11391143 then {
11401144 let cfg = getPoolConfig()
11411145 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11421146 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
1143- let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
1144- if ((unstakeInv == unstakeInv))
1147+ if ((currentKLp == currentKLp))
11451148 then {
1146- let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
1147- let outAmAmt = res._1
1148- let outPrAmt = res._2
1149- let poolStatus = parseIntValue(res._9)
1150- let state = res._10
1151- let checkPoolStatus = if (if (isGlobalShutdown())
1152- then true
1153- else (poolStatus == PoolShutdown))
1154- then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
1155- else true
1156- if ((checkPoolStatus == checkPoolStatus))
1149+ let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
1150+ if ((unstakeInv == unstakeInv))
11571151 then {
1158- let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
1159- if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1152+ let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
1153+ let outAmAmt = res._1
1154+ let outPrAmt = res._2
1155+ let poolStatus = parseIntValue(res._9)
1156+ let state = res._10
1157+ let checkPoolStatus = if (if (isGlobalShutdown())
1158+ then true
1159+ else (poolStatus == PoolShutdown))
1160+ then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
1161+ else true
1162+ if ((checkPoolStatus == checkPoolStatus))
11601163 then {
1161- let $t04445744538 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1162- let refreshKLpActions = $t04445744538._1
1163- let updatedKLp = $t04445744538._2
1164- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1165- if ((isUpdatedKLpValid == isUpdatedKLpValid))
1166- then (state ++ refreshKLpActions)
1164+ let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
1165+ if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1166+ then {
1167+ let $t04445844539 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1168+ let refreshKLpActions = $t04445844539._1
1169+ let updatedKLp = $t04445844539._2
1170+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1171+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
1172+ then (state ++ refreshKLpActions)
1173+ else throw("Strict value is not equal to itself.")
1174+ }
11671175 else throw("Strict value is not equal to itself.")
11681176 }
11691177 else throw("Strict value is not equal to itself.")
11701178 }
11711179 else throw("Strict value is not equal to itself.")
11721180 }
11731181 else throw("Strict value is not equal to itself.")
11741182 }
11751183 else throw("Strict value is not equal to itself.")
11761184 }
11771185
11781186
11791187
11801188 @Callable(i)
11811189 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11821190 let isGetDisabled = if (isGlobalShutdown())
11831191 then true
11841192 else (cfgPoolStatus == PoolShutdown)
11851193 let checks = [if (!(isGetDisabled))
11861194 then true
11871195 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11881196 then true
11891197 else throw("no payments are expected")]
11901198 if ((checks == checks))
11911199 then {
11921200 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
1193- let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
1194- if ((unstakeInv == unstakeInv))
1201+ if ((currentKLp == currentKLp))
11951202 then {
1196- let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
1197- let outAmAmt = res._1
1198- let outPrAmt = res._2
1199- let state = res._10
1200- let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
1201- then true
1202- else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
1203- then true
1204- else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
1205- if ((checkAmounts == checkAmounts))
1203+ let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
1204+ if ((unstakeInv == unstakeInv))
12061205 then {
1207- let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
1208- if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1206+ let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
1207+ let outAmAmt = res._1
1208+ let outPrAmt = res._2
1209+ let state = res._10
1210+ let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
1211+ then true
1212+ else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
1213+ then true
1214+ else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
1215+ if ((checkAmounts == checkAmounts))
12091216 then {
1210- let $t04583045911 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1211- let refreshKLpActions = $t04583045911._1
1212- let updatedKLp = $t04583045911._2
1213- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1214- if ((isUpdatedKLpValid == isUpdatedKLpValid))
1215- then (state ++ refreshKLpActions)
1217+ let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
1218+ if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1219+ then {
1220+ let $t04583445915 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1221+ let refreshKLpActions = $t04583445915._1
1222+ let updatedKLp = $t04583445915._2
1223+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1224+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
1225+ then (state ++ refreshKLpActions)
1226+ else throw("Strict value is not equal to itself.")
1227+ }
12161228 else throw("Strict value is not equal to itself.")
12171229 }
12181230 else throw("Strict value is not equal to itself.")
12191231 }
12201232 else throw("Strict value is not equal to itself.")
12211233 }
12221234 else throw("Strict value is not equal to itself.")
12231235 }
12241236 else throw("Strict value is not equal to itself.")
12251237 }
12261238
12271239
12281240
12291241 @Callable(i)
12301242 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12311243 then throw("permissions denied")
12321244 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12331245
12341246
12351247
12361248 @Callable(i)
12371249 func refreshKLp () = {
12381250 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12391251 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12401252 then unit
12411253 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12421254 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12431255 then {
12441256 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1245- let $t04709847162 = refreshKLpInternal(0, 0, 0)
1246- let kLpUpdateActions = $t04709847162._1
1247- let updatedKLp = $t04709847162._2
1257+ let $t04710247166 = refreshKLpInternal(0, 0, 0)
1258+ let kLpUpdateActions = $t04710247166._1
1259+ let updatedKLp = $t04710247166._2
12481260 let actions = if ((kLp != updatedKLp))
12491261 then kLpUpdateActions
12501262 else throwErr("nothing to refresh")
12511263 $Tuple2(actions, toString(updatedKLp))
12521264 }
12531265 else throw("Strict value is not equal to itself.")
12541266 }
12551267
12561268
12571269
12581270 @Callable(i)
12591271 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12601272
12611273
12621274
12631275 @Callable(i)
12641276 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12651277
12661278
12671279
12681280 @Callable(i)
12691281 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
12701282 let prices = calcPrices(amAmt, prAmt, lpAmt)
12711283 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
12721284 }
12731285
12741286
12751287
12761288 @Callable(i)
12771289 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
12781290
12791291
12801292
12811293 @Callable(i)
12821294 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
12831295
12841296
12851297
12861298 @Callable(i)
12871299 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
12881300
12891301
12901302
12911303 @Callable(i)
12921304 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
12931305
12941306
12951307
12961308 @Callable(i)
12971309 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
12981310 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
12991311 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
13001312 }
13011313
13021314
13031315
13041316 @Callable(i)
13051317 func statsREADONLY () = {
13061318 let cfg = getPoolConfig()
13071319 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13081320 let amtAssetId = cfg[idxAmtAssetId]
13091321 let priceAssetId = cfg[idxPriceAssetId]
13101322 let iAmtAssetId = cfg[idxIAmtAssetId]
13111323 let iPriceAssetId = cfg[idxIPriceAssetId]
13121324 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13131325 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13141326 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13151327 let accAmtAssetBalance = getAccBalance(amtAssetId)
13161328 let accPriceAssetBalance = getAccBalance(priceAssetId)
13171329 let pricesList = if ((poolLPBalance == 0))
13181330 then [zeroBigInt, zeroBigInt, zeroBigInt]
13191331 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
13201332 let curPrice = 0
13211333 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
13221334 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
13231335 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
13241336 $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))
13251337 }
13261338
13271339
13281340
13291341 @Callable(i)
13301342 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13311343 let cfg = getPoolConfig()
13321344 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13331345 let amAssetIdStr = cfg[idxAmtAssetId]
13341346 let amAssetId = fromBase58String(amAssetIdStr)
13351347 let prAssetIdStr = cfg[idxPriceAssetId]
13361348 let prAssetId = fromBase58String(prAssetIdStr)
13371349 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13381350 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13391351 let poolStatus = cfg[idxPoolStatus]
13401352 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13411353 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13421354 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13431355 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13441356 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13451357 let curPriceX18 = if ((poolLPBalance == 0))
13461358 then zeroBigInt
13471359 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13481360 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13491361 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13501362 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13511363 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13521364 let calcLpAmt = estPut._1
13531365 let curPriceCalc = estPut._3
13541366 let amBalance = estPut._4
13551367 let prBalance = estPut._5
13561368 let lpEmission = estPut._6
13571369 $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))
13581370 }
13591371
13601372
13611373
13621374 @Callable(i)
13631375 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
13641376 let cfg = getPoolConfig()
13651377 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13661378 let amAssetIdStr = cfg[idxAmtAssetId]
13671379 let amAssetId = fromBase58String(amAssetIdStr)
13681380 let prAssetIdStr = cfg[idxPriceAssetId]
13691381 let prAssetId = fromBase58String(prAssetIdStr)
13701382 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13711383 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13721384 let poolStatus = cfg[idxPoolStatus]
13731385 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13741386 let amBalanceRaw = getAccBalance(amAssetIdStr)
13751387 let prBalanceRaw = getAccBalance(prAssetIdStr)
13761388 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
13771389 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
13781390 let curPriceX18 = if ((poolLPBalance == 0))
13791391 then zeroBigInt
13801392 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
13811393 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
13821394 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
13831395 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
13841396 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13851397 let calcLpAmt = estPut._1
13861398 let curPriceCalc = estPut._3
13871399 let amBalance = estPut._4
13881400 let prBalance = estPut._5
13891401 let lpEmission = estPut._6
13901402 $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))
13911403 }
13921404
13931405
13941406
13951407 @Callable(i)
13961408 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
13971409 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
13981410 let outAmAmt = res._1
13991411 let outPrAmt = res._2
14001412 let amBalance = res._5
14011413 let prBalance = res._6
14021414 let lpEmission = res._7
14031415 let curPrice = res._8
14041416 let poolStatus = parseIntValue(res._9)
14051417 $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))
14061418 }
14071419
14081420
14091421 @Verifier(tx)
14101422 func verify () = {
14111423 let targetPublicKey = match managerPublicKeyOrUnit() {
14121424 case pk: ByteVector =>
14131425 pk
14141426 case _: Unit =>
14151427 tx.senderPublicKey
14161428 case _ =>
14171429 throw("Match error")
14181430 }
14191431 match tx {
14201432 case order: Order =>
14211433 let matcherPub = getMatcherPubOrFail()
14221434 let orderValid = validateMatcherOrderAllowed(order)
14231435 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14241436 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14251437 if (if (if (orderValid)
14261438 then senderValid
14271439 else false)
14281440 then matcherValid
14291441 else false)
14301442 then true
14311443 else throwOrderError(orderValid, senderValid, matcherValid)
14321444 case s: SetScriptTransaction =>
14331445 let newHash = blake2b256(value(s.script))
14341446 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14351447 let currentHash = scriptHash(this)
14361448 if (if ((allowedHash == newHash))
14371449 then (currentHash != newHash)
14381450 else false)
14391451 then true
14401452 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14411453 case _ =>
14421454 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14431455 }
14441456 }
14451457

github/deemru/w8io/026f985 
122.23 ms