tx · GE24pgEr6yjW1wACdqv9tTWNNUStTC1HyubAKEgNJsuD

3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT:  -0.03200000 Waves

2022.11.29 18:48 [2338589] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves

{ "type": 13, "id": "GE24pgEr6yjW1wACdqv9tTWNNUStTC1HyubAKEgNJsuD", "fee": 3200000, "feeAssetId": null, "timestamp": 1669736951429, "version": 1, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "22X97hAjr45GjKyW7TDcGYDb5vdmFiQjcnkTQHkijf1MZoEifDaETdjN7r2DP9iFqLpofa4v53xedAv5PwziqWHe" ], "script": "base64:BgLEJAgCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIECgIICBIECgIIARIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgAiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgpzbGlwcGFnZTREIgt3YXZlc1N0cmluZyIFQW11bHQiBURjb252IgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIgpQb29sUHV0RGlzIg5Qb29sTWF0Y2hlckRpcyIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyIJaWR4UG9vbFN0IglpZHhMUEFzSWQiCWlkeEFtQXNJZCIJaWR4UHJBc0lkIgtpZHhBbXRBc0RjbSINaWR4UHJpY2VBc0RjbSILaWR4SUFtdEFzSWQiDWlkeElQcmljZUFzSWQiD2lkeEZhY3RTdGFrQ250ciISaWR4RmFjd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UMCFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJlcQUCYUMEAmhrCQD2AwEJAQV2YWx1ZQEIBQJlcQZzY3JpcHQEAmhsCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYUwJAQJhdgAEAmhtCQDxBwEFBHRoaXMDAwkAAAIFAmhsBQJoawkBAiE9AgUCaG0FAmhrBwYJAPQDAwgFAmhkCWJvZHlCeXRlcwkAkQMCCAUCaGQGcHJvb2ZzAAAFAmhmCQD0AwMIBQJoZAlib2R5Qnl0ZXMJAJEDAggFAmhkBnByb29mcwAABQJoZnDQvME=", "chainId": 84, "height": 2338589, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7qeTDJZn4LaYsgJzFkLvUDfohq4PyThmF9agu58eqZ9N Next: 8rK5KoYi8F3fGjzvSu5FwGmBFHYG6WoL3ToAbYnfgLoC Diff:
OldNewDifferences
119119
120120 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
121121
122+let keyDLp = makeString(["%s", "dLp"], SEP)
123+
124+let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP)
125+
126+let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP)
127+
128+let dLpRefreshDelayDefault = 30
129+
130+let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault)
131+
122132 func fcfg () = "%s__factoryConfig"
123133
124134
160170 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
161171
162172
173+func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ")
174+
175+
163176 let fca = addressFromStringValue(strf(this, fc()))
164177
165178 let A = strf(this, amp())
196209
197210 let poolConfigParsed = parsePoolConfig(gpc())
198211
199-let $t068307016 = poolConfigParsed
212+let $t072087394 = poolConfigParsed
200213
201-let cfgPoolAddress = $t068307016._1
214+let cfgPoolAddress = $t072087394._1
202215
203-let cfgPoolStatus = $t068307016._2
216+let cfgPoolStatus = $t072087394._2
204217
205-let cfgLpAssetId = $t068307016._3
218+let cfgLpAssetId = $t072087394._3
206219
207-let cfgAmountAssetId = $t068307016._4
220+let cfgAmountAssetId = $t072087394._4
208221
209-let cfgPriceAssetId = $t068307016._5
222+let cfgPriceAssetId = $t072087394._5
210223
211-let cfgAmountAssetDecimals = $t068307016._6
224+let cfgAmountAssetDecimals = $t072087394._6
212225
213-let cfgPriceAssetDecimals = $t068307016._7
226+let cfgPriceAssetDecimals = $t072087394._7
214227
215228 func gfc () = split(strf(fca, fcfg()), SEP)
216229
405418 else calcLpAmt
406419 let amDiff = (inAmAmt - calcAmAssetPmt)
407420 let prDiff = (inPrAmt - calcPrAssetPmt)
408- let $t01744717792 = if (if (isOneAsset)
421+ let $t01782518170 = if (if (isOneAsset)
409422 then (pmtId == amIdStr)
410423 else false)
411424 then $Tuple2(pmtAmt, 0)
414427 else false)
415428 then $Tuple2(0, pmtAmt)
416429 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
417- let writeAmAmt = $t01744717792._1
418- let writePrAmt = $t01744717792._2
430+ let writeAmAmt = $t01782518170._1
431+ let writePrAmt = $t01782518170._2
419432 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
420433 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
421434 }
435+ }
436+
437+
438+func calcDLp (amountBalance,priceBalance,lpEmission) = {
439+ let updatedDLp = fraction((amountBalance * priceBalance), scale18, lpEmission)
440+ updatedDLp
441+ }
442+
443+
444+func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
445+ let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
446+ let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
447+ let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
448+ let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
449+ let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))]
450+ $Tuple2(actions, updatedDLp)
422451 }
423452
424453
515544 let ann_aPrecision = (ann - aPrecision)
516545 let n1 = (n + big1)
517546 func calc (acc,cur) = {
518- let $t02234422364 = acc
519- let d = $t02234422364._1
520- let found = $t02234422364._2
547+ let $t02363623656 = acc
548+ let d = $t02363623656._1
549+ let found = $t02363623656._2
521550 if ((found != unit))
522551 then acc
523552 else {
531560 }
532561
533562 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
534- let $t02278522832 = {
563+ let $t02407724124 = {
535564 let $l = arr
536565 let $s = size($l)
537566 let $acc0 = $Tuple2(s, unit)
545574
546575 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
547576 }
548- let d = $t02278522832._1
549- let found = $t02278522832._2
577+ let d = $t02407724124._1
578+ let found = $t02407724124._2
550579 if ((found != unit))
551580 then d
552581 else throw(("D calculation error, D = " + toString(d)))
566595 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
567596 let b = ((s + ((D * aPrecision) / ann)) - D)
568597 func calc (acc,cur) = {
569- let $t02333223352 = acc
570- let y = $t02333223352._1
571- let found = $t02333223352._2
598+ let $t02462424644 = acc
599+ let y = $t02462424644._1
600+ let found = $t02462424644._2
572601 if ((found != unit))
573602 then acc
574603 else {
581610 }
582611
583612 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
584- let $t02365923706 = {
613+ let $t02495124998 = {
585614 let $l = arr
586615 let $s = size($l)
587616 let $acc0 = $Tuple2(D, unit)
595624
596625 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
597626 }
598- let y = $t02365923706._1
599- let found = $t02365923706._2
627+ let y = $t02495124998._1
628+ let found = $t02495124998._2
600629 if ((found != unit))
601630 then y
602631 else throw(("Y calculation error, Y = " + toString(y)))
618647 then {
619648 let amBalance = getAccBalance(amId)
620649 let prBalance = getAccBalance(prId)
621- let $t02448924951 = if ((txId == ""))
650+ let $t02578126243 = if ((txId == ""))
622651 then $Tuple2(amBalance, prBalance)
623652 else if ((pmtAssetId == amId))
624653 then if ((pmtAmtRaw > amBalance))
629658 then throw("invalid payment amount")
630659 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
631660 else throw("wrong pmtAssetId")
632- let amBalanceOld = $t02448924951._1
633- let prBalanceOld = $t02448924951._2
634- let $t02495725133 = if ((pmtAssetId == amId))
661+ let amBalanceOld = $t02578126243._1
662+ let prBalanceOld = $t02578126243._2
663+ let $t02624926425 = if ((pmtAssetId == amId))
635664 then $Tuple2(pmtAmtRaw, 0)
636665 else if ((pmtAssetId == prId))
637666 then $Tuple2(0, pmtAmtRaw)
638667 else throw("invalid payment")
639- let amAmountRaw = $t02495725133._1
640- let prAmountRaw = $t02495725133._2
641- let $t02513725376 = if (withTakeFee)
668+ let amAmountRaw = $t02624926425._1
669+ let prAmountRaw = $t02624926425._2
670+ let $t02642926668 = if (withTakeFee)
642671 then $Tuple3(takeFee(amAmountRaw)._1, takeFee(prAmountRaw)._1, takeFee(pmtAmtRaw)._2)
643672 else $Tuple3(amAmountRaw, prAmountRaw, 0)
644- let amAmount = $t02513725376._1
645- let prAmount = $t02513725376._2
646- let feeAmount = $t02513725376._3
673+ let amAmount = $t02642926668._1
674+ let prAmount = $t02642926668._2
675+ let feeAmount = $t02642926668._3
647676 let amBalanceNew = (amBalanceOld + amAmount)
648677 let prBalanceNew = (prBalanceOld + prAmount)
649678 let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)])
689718 else {
690719 let amBalance = getAccBalance(amId)
691720 let prBalance = getAccBalance(prId)
692- let $t02737827489 = {
721+ let $t02867028781 = {
693722 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
694723 if ($isInstanceOf(@, "(Int, Int)"))
695724 then @
696725 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
697726 }
698- if (($t02737827489 == $t02737827489))
727+ if (($t02867028781 == $t02867028781))
699728 then {
700- let feeAmount = $t02737827489._2
701- let totalGet = $t02737827489._1
729+ let feeAmount = $t02867028781._2
730+ let totalGet = $t02867028781._1
702731 let totalAmount = if (if ((minOutAmount > 0))
703732 then (minOutAmount > totalGet)
704733 else false)
705734 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
706735 else totalGet
707- let $t02767927986 = if ((outAssetId == amId))
736+ let $t02897129278 = if ((outAssetId == amId))
708737 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
709738 else if ((outAssetId == prId))
710739 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
711740 else throw("invalid out asset id")
712- let outAm = $t02767927986._1
713- let outPr = $t02767927986._2
714- let amBalanceNew = $t02767927986._3
715- let prBalanceNew = $t02767927986._4
741+ let outAm = $t02897129278._1
742+ let outPr = $t02897129278._2
743+ let amBalanceNew = $t02897129278._3
744+ let prBalanceNew = $t02897129278._4
716745 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
717746 let curPr = f1(curPrX18, scale8)
718747 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
924953 let pmt = value(i.payments[0])
925954 let pmtAssetId = toBase58String(value(pmt.assetId))
926955 let pmtAmt = pmt.amount
927- let $t03334833506 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
928- if (($t03334833506 == $t03334833506))
956+ let $t03464034798 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
957+ if (($t03464034798 == $t03464034798))
929958 then {
930- let feeAmount = $t03334833506._3
931- let state = $t03334833506._2
932- let estimLP = $t03334833506._1
959+ let feeAmount = $t03464034798._3
960+ let state = $t03464034798._2
961+ let estimLP = $t03464034798._1
933962 let emitLpAmt = if (if ((minOutAmount > 0))
934963 then (minOutAmount > estimLP)
935964 else false)
10201049 else throwErr("exactly 1 payment are expected")]
10211050 if ((checks == checks))
10221051 then {
1023- let $t03612836283 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1024- let state = $t03612836283._1
1025- let totalAmount = $t03612836283._2
1052+ let $t03742037575 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1053+ let state = $t03742037575._1
1054+ let totalAmount = $t03742037575._2
10261055 $Tuple2(state, totalAmount)
10271056 }
10281057 else throw("Strict value is not equal to itself.")
10531082 let newY = getYD(xp, index, D1)
10541083 let dy = (xp[index] - newY)
10551084 let totalGetRaw = max([0, toInt((dy - big1))])
1056- let $t03712437173 = takeFee(totalGetRaw)
1057- let totalGet = $t03712437173._1
1058- let feeAmount = $t03712437173._2
1085+ let $t03841638465 = takeFee(totalGetRaw)
1086+ let totalGet = $t03841638465._1
1087+ let feeAmount = $t03841638465._2
10591088 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
10601089 }
10611090
10691098 let lpId = poolConfig[idxLPAsId]
10701099 let amBalance = getAccBalance(amId)
10711100 let prBalance = getAccBalance(prId)
1072- let $t03751837633 = {
1101+ let $t03881038925 = {
10731102 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
10741103 if ($isInstanceOf(@, "(Int, Int)"))
10751104 then @
10761105 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
10771106 }
1078- let totalGet = $t03751837633._1
1079- let feeAmount = $t03751837633._2
1107+ let totalGet = $t03881038925._1
1108+ let feeAmount = $t03881038925._2
10801109 let r = ego("", lpId, lpAssetAmount, this)
10811110 let outAmAmt = r._1
10821111 let outPrAmt = r._2
12201249 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil)
12211250 if ((unstakeInv == unstakeInv))
12221251 then {
1223- let $t04147141659 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1224- let state = $t04147141659._1
1225- let totalAmount = $t04147141659._2
1252+ let $t04276342951 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1253+ let state = $t04276342951._1
1254+ let totalAmount = $t04276342951._2
12261255 $Tuple2(state, totalAmount)
12271256 }
12281257 else throw("Strict value is not equal to itself.")
12381267 let amId = poolConfig[idxAmAsId]
12391268 let prId = poolConfig[idxPrAsId]
12401269 let lpId = poolConfig[idxLPAsId]
1241- let $t04191842021 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1242- let lpAmount = $t04191842021._1
1243- let state = $t04191842021._2
1244- let feeAmount = $t04191842021._3
1245- let bonus = $t04191842021._4
1270+ let $t04321043313 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1271+ let lpAmount = $t04321043313._1
1272+ let state = $t04321043313._2
1273+ let feeAmount = $t04321043313._3
1274+ let bonus = $t04321043313._4
12461275 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
12471276 }
12481277
12541283 let amId = poolConfig[idxAmAsId]
12551284 let prId = poolConfig[idxPrAsId]
12561285 let lpId = poolConfig[idxLPAsId]
1257- let $t04230042404 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1258- let lpAmount = $t04230042404._1
1259- let state = $t04230042404._2
1260- let feeAmount = $t04230042404._3
1261- let bonus = $t04230042404._4
1286+ let $t04359243696 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1287+ let lpAmount = $t04359243696._1
1288+ let state = $t04359243696._2
1289+ let feeAmount = $t04359243696._3
1290+ let bonus = $t04359243696._4
12621291 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
12631292 }
12641293
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let scale8 = 100000000
55
66 let scale8BigInt = toBigInt(100000000)
77
88 let scale18 = toBigInt(1000000000000000000)
99
1010 let zeroBigInt = toBigInt(0)
1111
1212 let big0 = toBigInt(0)
1313
1414 let big1 = toBigInt(1)
1515
1616 let big2 = toBigInt(2)
1717
1818 let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8)))
1919
2020 let wavesString = "WAVES"
2121
2222 let Amult = "100"
2323
2424 let Dconv = "1"
2525
2626 let SEP = "__"
2727
2828 let EMPTY = ""
2929
3030 let PoolActive = 1
3131
3232 let PoolPutDis = 2
3333
3434 let PoolMatcherDis = 3
3535
3636 let PoolShutdown = 4
3737
3838 let idxPoolAddress = 1
3939
4040 let idxPoolSt = 2
4141
4242 let idxLPAsId = 3
4343
4444 let idxAmAsId = 4
4545
4646 let idxPrAsId = 5
4747
4848 let idxAmtAsDcm = 6
4949
5050 let idxPriceAsDcm = 7
5151
5252 let idxIAmtAsId = 8
5353
5454 let idxIPriceAsId = 9
5555
5656 let idxFactStakCntr = 1
5757
5858 let idxFactoryRestCntr = 6
5959
6060 let idxFactSlippCntr = 7
6161
6262 let idxFactGwxRewCntr = 10
6363
6464 let feeDefault = fraction(10, scale8, 10000)
6565
6666 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6767
6868
6969 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
7070
7171
7272 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7373
7474
7575 func abs (val) = if ((zeroBigInt > val))
7676 then -(val)
7777 else val
7878
7979
8080 func absBigInt (val) = if ((zeroBigInt > val))
8181 then -(val)
8282 else val
8383
8484
8585 func fc () = "%s__factoryContract"
8686
8787
8888 func mpk () = "%s__managerPublicKey"
8989
9090
9191 func pmpk () = "%s__pendingManagerPublicKey"
9292
9393
9494 func pl () = "%s%s__price__last"
9595
9696
9797 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
9898
9999
100100 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
101101
102102
103103 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
104104
105105
106106 func aa () = "%s__amountAsset"
107107
108108
109109 func pa () = "%s__priceAsset"
110110
111111
112112 func amp () = "%s__amp"
113113
114114
115115 func ada () = "%s__addonAddr"
116116
117117
118118 let keyFee = "%s__fee"
119119
120120 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
121121
122+let keyDLp = makeString(["%s", "dLp"], SEP)
123+
124+let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP)
125+
126+let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP)
127+
128+let dLpRefreshDelayDefault = 30
129+
130+let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault)
131+
122132 func fcfg () = "%s__factoryConfig"
123133
124134
125135 func mtpk () = "%s%s__matcher__publicKey"
126136
127137
128138 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
129139
130140
131141 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
132142
133143
134144 func aps () = "%s__shutdown"
135145
136146
137147 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
138148
139149
140150 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
141151
142152
143153 func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV)))
144154
145155
146156 func str (val) = match val {
147157 case valStr: String =>
148158 valStr
149159 case _ =>
150160 throw("fail cast to String")
151161 }
152162
153163
154164 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
155165
156166
157167 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
158168
159169
160170 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
161171
162172
173+func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ")
174+
175+
163176 let fca = addressFromStringValue(strf(this, fc()))
164177
165178 let A = strf(this, amp())
166179
167180 func igs () = valueOrElse(getBoolean(fca, aps()), false)
168181
169182
170183 func mp () = fromBase58String(strf(fca, mtpk()))
171184
172185
173186 let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress()))
174187
175188 func gpc () = {
176189 let amtAs = strf(this, aa())
177190 let priceAs = strf(this, pa())
178191 let iPriceAs = intf(fca, mba(priceAs))
179192 let iAmtAs = intf(fca, mba(amtAs))
180193 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
181194 }
182195
183196
184197 func parseAssetId (input) = if ((input == wavesString))
185198 then unit
186199 else fromBase58String(input)
187200
188201
189202 func assetIdToString (input) = if ((input == unit))
190203 then wavesString
191204 else toBase58String(value(input))
192205
193206
194207 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]))
195208
196209
197210 let poolConfigParsed = parsePoolConfig(gpc())
198211
199-let $t068307016 = poolConfigParsed
212+let $t072087394 = poolConfigParsed
200213
201-let cfgPoolAddress = $t068307016._1
214+let cfgPoolAddress = $t072087394._1
202215
203-let cfgPoolStatus = $t068307016._2
216+let cfgPoolStatus = $t072087394._2
204217
205-let cfgLpAssetId = $t068307016._3
218+let cfgLpAssetId = $t072087394._3
206219
207-let cfgAmountAssetId = $t068307016._4
220+let cfgAmountAssetId = $t072087394._4
208221
209-let cfgPriceAssetId = $t068307016._5
222+let cfgPriceAssetId = $t072087394._5
210223
211-let cfgAmountAssetDecimals = $t068307016._6
224+let cfgAmountAssetDecimals = $t072087394._6
212225
213-let cfgPriceAssetDecimals = $t068307016._7
226+let cfgPriceAssetDecimals = $t072087394._7
214227
215228 func gfc () = split(strf(fca, fcfg()), SEP)
216229
217230
218231 let factoryConfig = gfc()
219232
220233 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
221234
222235 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
223236
224237 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
225238
226239 let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address")
227240
228241 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slipByUser,slippageReal,txHeight,txTimestamp,slipageAmAmt,slipagePrAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slipByUser), toString(slippageReal), toString(txHeight), toString(txTimestamp), toString(slipageAmAmt), toString(slipagePrAmt)], SEP)
229242
230243
231244 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)
232245
233246
234247 func getAccBalance (assetId) = if ((assetId == "WAVES"))
235248 then wavesBalance(this).available
236249 else assetBalance(this, fromBase58String(assetId))
237250
238251
239252 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
240253
241254
242255 func vad (A1,A2,slippage) = {
243256 let diff = fraction((A1 - A2), scale8BigInt, A2)
244257 let pass = ((slippage - abs(diff)) > zeroBigInt)
245258 if (!(pass))
246259 then throw(("Big slpg: " + toString(diff)))
247260 else $Tuple2(pass, min([A1, A2]))
248261 }
249262
250263
251264 func vd (D1,D0,slpg) = {
252265 let diff = fraction(D0, scale8BigInt, D1)
253266 let fail = (slpg > diff)
254267 if (if (fail)
255268 then true
256269 else (D0 > D1))
257270 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
258271 else fail
259272 }
260273
261274
262275 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
263276 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
264277 let prAsAmtX18 = t1(prAmt, prAssetDcm)
265278 cpbi(prAsAmtX18, amtAsAmtX18)
266279 }
267280
268281
269282 func calcPrices (amAmt,prAmt,lpAmt) = {
270283 let cfg = gpc()
271284 let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm])
272285 let prAsDcm = parseIntValue(cfg[idxPriceAsDcm])
273286 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
274287 let amAmtX18 = t1(amAmt, amtAsDcm)
275288 let prAmtX18 = t1(prAmt, prAsDcm)
276289 let lpAmtX18 = t1(lpAmt, scale8)
277290 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
278291 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
279292 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
280293 }
281294
282295
283296 func calculatePrices (amAmt,prAmt,lpAmt) = {
284297 let p = calcPrices(amAmt, prAmt, lpAmt)
285298 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
286299 }
287300
288301
289302 func takeFee (amount) = {
290303 let feeAmount = fraction(amount, fee, scale8)
291304 $Tuple2((amount - feeAmount), feeAmount)
292305 }
293306
294307
295308 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
296309 let cfg = gpc()
297310 let lpId = cfg[idxLPAsId]
298311 let amId = cfg[idxAmAsId]
299312 let prId = cfg[idxPrAsId]
300313 let amDcm = parseIntValue(cfg[idxAmtAsDcm])
301314 let prDcm = parseIntValue(cfg[idxPriceAsDcm])
302315 let sts = cfg[idxPoolSt]
303316 let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity
304317 if ((lpId != pmtAssetId))
305318 then throw("Wrong pmt asset")
306319 else {
307320 let amBalance = getAccBalance(amId)
308321 let amBalanceX18 = t1(amBalance, amDcm)
309322 let prBalance = getAccBalance(prId)
310323 let prBalanceX18 = t1(prBalance, prDcm)
311324 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
312325 let curPrice = f1(curPriceX18, scale8)
313326 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
314327 let lpEmissX18 = t1(lpEmiss, scale8)
315328 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
316329 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
317330 let outAmAmt = f1(outAmAmtX18, amDcm)
318331 let outPrAmt = f1(outPrAmtX18, prDcm)
319332 let state = if ((txId58 == ""))
320333 then nil
321334 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
322335 then unit
323336 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
324337 then unit
325338 else fromBase58String(prId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
326339 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
327340 }
328341 }
329342
330343
331344 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
332345 let cfg = gpc()
333346 let lpId = fromBase58String(cfg[idxLPAsId])
334347 let amIdStr = cfg[idxAmAsId]
335348 let prIdStr = cfg[idxPrAsId]
336349 let inAmIdStr = cfg[idxIAmtAsId]
337350 let inPrIdStr = cfg[idxIPriceAsId]
338351 let amtDcm = parseIntValue(cfg[idxAmtAsDcm])
339352 let priceDcm = parseIntValue(cfg[idxPriceAsDcm])
340353 let sts = cfg[idxPoolSt]
341354 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
342355 let amBalance = if (isEval)
343356 then getAccBalance(amIdStr)
344357 else if (if (isOneAsset)
345358 then (pmtId == amIdStr)
346359 else false)
347360 then (getAccBalance(amIdStr) - pmtAmt)
348361 else if (isOneAsset)
349362 then getAccBalance(amIdStr)
350363 else (getAccBalance(amIdStr) - inAmAmt)
351364 let prBalance = if (isEval)
352365 then getAccBalance(prIdStr)
353366 else if (if (isOneAsset)
354367 then (pmtId == prIdStr)
355368 else false)
356369 then (getAccBalance(prIdStr) - pmtAmt)
357370 else if (isOneAsset)
358371 then getAccBalance(prIdStr)
359372 else (getAccBalance(prIdStr) - inPrAmt)
360373 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
361374 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
362375 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
363376 let amBalanceX18 = t1(amBalance, amtDcm)
364377 let prBalanceX18 = t1(prBalance, priceDcm)
365378 let r = if ((lpEm == 0))
366379 then {
367380 let curPriceX18 = zeroBigInt
368381 let slippageX18 = zeroBigInt
369382 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
370383 $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
371384 }
372385 else {
373386 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
374387 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
375388 let slippageX18 = t1(slippage, scale8)
376389 if (if (if (validateSlippage)
377390 then (curPriceX18 != zeroBigInt)
378391 else false)
379392 then (slippageRealX18 > slippageX18)
380393 else false)
381394 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
382395 else {
383396 let lpEmissionX18 = t1(lpEm, scale8)
384397 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
385398 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
386399 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
387400 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
388401 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
389402 let expAmtAssetAmtX18 = expectedAmts._1
390403 let expPriceAssetAmtX18 = expectedAmts._2
391404 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
392405 $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18)
393406 }
394407 }
395408 let calcLpAmt = r._1
396409 let calcAmAssetPmt = r._2
397410 let calcPrAssetPmt = r._3
398411 let curPrice = f1(r._4, scale8)
399412 let slippageCalc = f1(r._5, scale8)
400413 if ((0 >= calcLpAmt))
401414 then throw("LP <= 0")
402415 else {
403416 let emitLpAmt = if (!(emitLp))
404417 then 0
405418 else calcLpAmt
406419 let amDiff = (inAmAmt - calcAmAssetPmt)
407420 let prDiff = (inPrAmt - calcPrAssetPmt)
408- let $t01744717792 = if (if (isOneAsset)
421+ let $t01782518170 = if (if (isOneAsset)
409422 then (pmtId == amIdStr)
410423 else false)
411424 then $Tuple2(pmtAmt, 0)
412425 else if (if (isOneAsset)
413426 then (pmtId == prIdStr)
414427 else false)
415428 then $Tuple2(0, pmtAmt)
416429 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
417- let writeAmAmt = $t01744717792._1
418- let writePrAmt = $t01744717792._2
430+ let writeAmAmt = $t01782518170._1
431+ let writePrAmt = $t01782518170._2
419432 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
420433 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
421434 }
435+ }
436+
437+
438+func calcDLp (amountBalance,priceBalance,lpEmission) = {
439+ let updatedDLp = fraction((amountBalance * priceBalance), scale18, lpEmission)
440+ updatedDLp
441+ }
442+
443+
444+func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
445+ let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
446+ let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
447+ let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
448+ let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
449+ let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))]
450+ $Tuple2(actions, updatedDLp)
422451 }
423452
424453
425454 func moa (order) = {
426455 let cfg = gpc()
427456 let amtAsId = cfg[idxAmAsId]
428457 let prAsId = cfg[idxPrAsId]
429458 let sts = parseIntValue(cfg[idxPoolSt])
430459 let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm])
431460 let prAsDcm = parseIntValue(cfg[idxPriceAsDcm])
432461 let accAmtAsBalance = getAccBalance(amtAsId)
433462 let accPrAsBalance = getAccBalance(prAsId)
434463 let curPriceX18 = if ((order.orderType == Buy))
435464 then pcp(amtAsDcm, prAsDcm, (accAmtAsBalance + order.amount), accPrAsBalance)
436465 else pcp(amtAsDcm, prAsDcm, (accAmtAsBalance - order.amount), accPrAsBalance)
437466 let curPrice = f1(curPriceX18, scale8)
438467 if (if (if (igs())
439468 then true
440469 else (sts == PoolMatcherDis))
441470 then true
442471 else (sts == PoolShutdown))
443472 then throw("Admin blocked")
444473 else {
445474 let orAmtAsset = order.assetPair.amountAsset
446475 let orAmtAsStr = if ((orAmtAsset == unit))
447476 then "WAVES"
448477 else toBase58String(value(orAmtAsset))
449478 let orPrAsset = order.assetPair.priceAsset
450479 let orPrAsStr = if ((orPrAsset == unit))
451480 then "WAVES"
452481 else toBase58String(value(orPrAsset))
453482 if (if ((orAmtAsStr != amtAsId))
454483 then true
455484 else (orPrAsStr != prAsId))
456485 then throw("Wr assets")
457486 else {
458487 let orderPrice = order.price
459488 let priceDcm = fraction(scale8, prAsDcm, amtAsDcm)
460489 let castOrderPrice = ts(orderPrice, scale8, priceDcm)
461490 let isOrderPriceValid = if ((order.orderType == Buy))
462491 then (curPrice >= castOrderPrice)
463492 else (castOrderPrice >= curPrice)
464493 true
465494 }
466495 }
467496 }
468497
469498
470499 func cg (i) = if ((size(i.payments) != 1))
471500 then throw("1 pmnt exp")
472501 else {
473502 let pmt = value(i.payments[0])
474503 let pmtAssetId = value(pmt.assetId)
475504 let pmtAmt = pmt.amount
476505 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
477506 let outAmAmt = r._1
478507 let outPrAmt = r._2
479508 let sts = parseIntValue(r._9)
480509 let state = r._10
481510 if (if (igs())
482511 then true
483512 else (sts == PoolShutdown))
484513 then throw(("Admin blocked: " + toString(sts)))
485514 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
486515 }
487516
488517
489518 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
490519 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
491520 let sts = parseIntValue(r._8)
492521 if (if (if (igs())
493522 then true
494523 else (sts == PoolPutDis))
495524 then true
496525 else (sts == PoolShutdown))
497526 then throw(("Blocked:" + toString(sts)))
498527 else r
499528 }
500529
501530
502531 func getD (xp) = {
503532 let n = big2
504533 let xp0 = xp[0]
505534 let xp1 = xp[1]
506535 let aPrecision = parseBigIntValue(Amult)
507536 let a = (parseBigIntValue(A) * aPrecision)
508537 let s = (xp0 + xp1)
509538 if ((s == big0))
510539 then big0
511540 else {
512541 let ann = (a * n)
513542 let xp0_xp1_n_n = (((xp0 * xp1) * n) * n)
514543 let ann_s_aPrecision = ((ann * s) / aPrecision)
515544 let ann_aPrecision = (ann - aPrecision)
516545 let n1 = (n + big1)
517546 func calc (acc,cur) = {
518- let $t02234422364 = acc
519- let d = $t02234422364._1
520- let found = $t02234422364._2
547+ let $t02363623656 = acc
548+ let d = $t02363623656._1
549+ let found = $t02363623656._2
521550 if ((found != unit))
522551 then acc
523552 else {
524553 let dp = (((d * d) * d) / xp0_xp1_n_n)
525554 let dNext = (((ann_s_aPrecision + (dp * n)) * d) / (((ann_aPrecision * d) / aPrecision) + (n1 * dp)))
526555 let dDiff = absBigInt((dNext - value(d)))
527556 if ((big1 >= dDiff))
528557 then $Tuple2(dNext, cur)
529558 else $Tuple2(dNext, unit)
530559 }
531560 }
532561
533562 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
534- let $t02278522832 = {
563+ let $t02407724124 = {
535564 let $l = arr
536565 let $s = size($l)
537566 let $acc0 = $Tuple2(s, unit)
538567 func $f0_1 ($a,$i) = if (($i >= $s))
539568 then $a
540569 else calc($a, $l[$i])
541570
542571 func $f0_2 ($a,$i) = if (($i >= $s))
543572 then $a
544573 else throw("List size exceeds 15")
545574
546575 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
547576 }
548- let d = $t02278522832._1
549- let found = $t02278522832._2
577+ let d = $t02407724124._1
578+ let found = $t02407724124._2
550579 if ((found != unit))
551580 then d
552581 else throw(("D calculation error, D = " + toString(d)))
553582 }
554583 }
555584
556585
557586 func getYD (xp,i,D) = {
558587 let n = big2
559588 let x = xp[if ((i == 0))
560589 then 1
561590 else 0]
562591 let aPrecision = parseBigIntValue(Amult)
563592 let a = (parseBigIntValue(A) * aPrecision)
564593 let s = x
565594 let ann = (a * n)
566595 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
567596 let b = ((s + ((D * aPrecision) / ann)) - D)
568597 func calc (acc,cur) = {
569- let $t02333223352 = acc
570- let y = $t02333223352._1
571- let found = $t02333223352._2
598+ let $t02462424644 = acc
599+ let y = $t02462424644._1
600+ let found = $t02462424644._2
572601 if ((found != unit))
573602 then acc
574603 else {
575604 let yNext = (((y * y) + c) / ((big2 * y) + b))
576605 let yDiff = absBigInt((yNext - value(y)))
577606 if ((big1 >= yDiff))
578607 then $Tuple2(yNext, cur)
579608 else $Tuple2(yNext, unit)
580609 }
581610 }
582611
583612 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
584- let $t02365923706 = {
613+ let $t02495124998 = {
585614 let $l = arr
586615 let $s = size($l)
587616 let $acc0 = $Tuple2(D, unit)
588617 func $f0_1 ($a,$i) = if (($i >= $s))
589618 then $a
590619 else calc($a, $l[$i])
591620
592621 func $f0_2 ($a,$i) = if (($i >= $s))
593622 then $a
594623 else throw("List size exceeds 15")
595624
596625 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
597626 }
598- let y = $t02365923706._1
599- let found = $t02365923706._2
627+ let y = $t02495124998._1
628+ let found = $t02495124998._2
600629 if ((found != unit))
601630 then y
602631 else throw(("Y calculation error, Y = " + toString(y)))
603632 }
604633
605634
606635 func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = {
607636 let poolConfig = gpc()
608637 let amId = poolConfig[idxAmAsId]
609638 let prId = poolConfig[idxPrAsId]
610639 let lpId = poolConfig[idxLPAsId]
611640 let amtDcm = parseIntValue(poolConfig[idxAmtAsDcm])
612641 let priceDcm = parseIntValue(poolConfig[idxPriceAsDcm])
613642 let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
614643 let chechEmission = if ((lpAssetEmission > big0))
615644 then true
616645 else throw("initial deposit requires all coins")
617646 if ((chechEmission == chechEmission))
618647 then {
619648 let amBalance = getAccBalance(amId)
620649 let prBalance = getAccBalance(prId)
621- let $t02448924951 = if ((txId == ""))
650+ let $t02578126243 = if ((txId == ""))
622651 then $Tuple2(amBalance, prBalance)
623652 else if ((pmtAssetId == amId))
624653 then if ((pmtAmtRaw > amBalance))
625654 then throw("invalid payment amount")
626655 else $Tuple2((amBalance - pmtAmtRaw), prBalance)
627656 else if ((pmtAssetId == prId))
628657 then if ((pmtAmtRaw > prBalance))
629658 then throw("invalid payment amount")
630659 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
631660 else throw("wrong pmtAssetId")
632- let amBalanceOld = $t02448924951._1
633- let prBalanceOld = $t02448924951._2
634- let $t02495725133 = if ((pmtAssetId == amId))
661+ let amBalanceOld = $t02578126243._1
662+ let prBalanceOld = $t02578126243._2
663+ let $t02624926425 = if ((pmtAssetId == amId))
635664 then $Tuple2(pmtAmtRaw, 0)
636665 else if ((pmtAssetId == prId))
637666 then $Tuple2(0, pmtAmtRaw)
638667 else throw("invalid payment")
639- let amAmountRaw = $t02495725133._1
640- let prAmountRaw = $t02495725133._2
641- let $t02513725376 = if (withTakeFee)
668+ let amAmountRaw = $t02624926425._1
669+ let prAmountRaw = $t02624926425._2
670+ let $t02642926668 = if (withTakeFee)
642671 then $Tuple3(takeFee(amAmountRaw)._1, takeFee(prAmountRaw)._1, takeFee(pmtAmtRaw)._2)
643672 else $Tuple3(amAmountRaw, prAmountRaw, 0)
644- let amAmount = $t02513725376._1
645- let prAmount = $t02513725376._2
646- let feeAmount = $t02513725376._3
673+ let amAmount = $t02642926668._1
674+ let prAmount = $t02642926668._2
675+ let feeAmount = $t02642926668._3
647676 let amBalanceNew = (amBalanceOld + amAmount)
648677 let prBalanceNew = (prBalanceOld + prAmount)
649678 let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)])
650679 let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)])
651680 let checkD = if ((D1 > D0))
652681 then true
653682 else throw()
654683 if ((checkD == checkD))
655684 then {
656685 let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0)
657686 let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8)
658687 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId), dataPutActionInfo(amAmountRaw, prAmountRaw, toInt(lpAmount), curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))]
659688 let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld)
660689 let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8))
661690 let priceAssetPart = (pmtAmtRaw - amountAssetPart)
662691 let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld))
663692 let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth))
664693 $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus)
665694 }
666695 else throw("Strict value is not equal to itself.")
667696 }
668697 else throw("Strict value is not equal to itself.")
669698 }
670699
671700
672701 func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = {
673702 let poolConfig = gpc()
674703 let lpId = poolConfig[idxLPAsId]
675704 let amId = poolConfig[idxAmAsId]
676705 let prId = poolConfig[idxPrAsId]
677706 let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm])
678707 let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm])
679708 let poolStatus = poolConfig[idxPoolSt]
680709 let userAddress = if ((caller == restContract))
681710 then originCaller
682711 else caller
683712 let pmt = value(payments[0])
684713 let pmtAssetId = value(pmt.assetId)
685714 let pmtAmt = pmt.amount
686715 let txId58 = toBase58String(transactionId)
687716 if ((lpId != toBase58String(pmtAssetId)))
688717 then throw("Wrong LP")
689718 else {
690719 let amBalance = getAccBalance(amId)
691720 let prBalance = getAccBalance(prId)
692- let $t02737827489 = {
721+ let $t02867028781 = {
693722 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
694723 if ($isInstanceOf(@, "(Int, Int)"))
695724 then @
696725 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
697726 }
698- if (($t02737827489 == $t02737827489))
727+ if (($t02867028781 == $t02867028781))
699728 then {
700- let feeAmount = $t02737827489._2
701- let totalGet = $t02737827489._1
729+ let feeAmount = $t02867028781._2
730+ let totalGet = $t02867028781._1
702731 let totalAmount = if (if ((minOutAmount > 0))
703732 then (minOutAmount > totalGet)
704733 else false)
705734 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
706735 else totalGet
707- let $t02767927986 = if ((outAssetId == amId))
736+ let $t02897129278 = if ((outAssetId == amId))
708737 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
709738 else if ((outAssetId == prId))
710739 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
711740 else throw("invalid out asset id")
712- let outAm = $t02767927986._1
713- let outPr = $t02767927986._2
714- let amBalanceNew = $t02767927986._3
715- let prBalanceNew = $t02767927986._4
741+ let outAm = $t02897129278._1
742+ let outPr = $t02897129278._2
743+ let amBalanceNew = $t02897129278._3
744+ let prBalanceNew = $t02897129278._4
716745 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
717746 let curPr = f1(curPrX18, scale8)
718747 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
719748 then unit
720749 else fromBase58String(outAssetId)
721750 let sendFeeToMatcher = if ((feeAmount > 0))
722751 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)]
723752 else nil
724753 let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher)
725754 if ((state == state))
726755 then {
727756 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
728757 if ((burn == burn))
729758 then $Tuple2(state, totalAmount)
730759 else throw("Strict value is not equal to itself.")
731760 }
732761 else throw("Strict value is not equal to itself.")
733762 }
734763 else throw("Strict value is not equal to itself.")
735764 }
736765 }
737766
738767
739768 func m () = match getString(mpk()) {
740769 case s: String =>
741770 fromBase58String(s)
742771 case _: Unit =>
743772 unit
744773 case _ =>
745774 throw("Match error")
746775 }
747776
748777
749778 func pm () = match getString(pmpk()) {
750779 case s: String =>
751780 fromBase58String(s)
752781 case _: Unit =>
753782 unit
754783 case _ =>
755784 throw("Match error")
756785 }
757786
758787
759788 let pd = throw("Permission denied")
760789
761790 func isManager (i) = match m() {
762791 case pk: ByteVector =>
763792 (i.callerPublicKey == pk)
764793 case _: Unit =>
765794 (i.caller == this)
766795 case _ =>
767796 throw("Match error")
768797 }
769798
770799
771800 func mm (i) = match m() {
772801 case pk: ByteVector =>
773802 if ((i.callerPublicKey == pk))
774803 then true
775804 else pd
776805 case _: Unit =>
777806 if ((i.caller == this))
778807 then true
779808 else pd
780809 case _ =>
781810 throw("Match error")
782811 }
783812
784813
785814 @Callable(i)
786815 func constructor (fc) = {
787816 let c = mm(i)
788817 if ((c == c))
789818 then [StringEntry(fc(), fc)]
790819 else throw("Strict value is not equal to itself.")
791820 }
792821
793822
794823
795824 @Callable(i)
796825 func setManager (pendingManagerPublicKey) = {
797826 let c = mm(i)
798827 if ((c == c))
799828 then {
800829 let cm = fromBase58String(pendingManagerPublicKey)
801830 if ((cm == cm))
802831 then [StringEntry(pmpk(), pendingManagerPublicKey)]
803832 else throw("Strict value is not equal to itself.")
804833 }
805834 else throw("Strict value is not equal to itself.")
806835 }
807836
808837
809838
810839 @Callable(i)
811840 func confirmManager () = {
812841 let p = pm()
813842 let hpm = if (isDefined(p))
814843 then true
815844 else throw("No pending manager")
816845 if ((hpm == hpm))
817846 then {
818847 let cpm = if ((i.callerPublicKey == value(p)))
819848 then true
820849 else throw("You are not pending manager")
821850 if ((cpm == cpm))
822851 then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
823852 else throw("Strict value is not equal to itself.")
824853 }
825854 else throw("Strict value is not equal to itself.")
826855 }
827856
828857
829858
830859 @Callable(i)
831860 func put (slip,autoStake) = {
832861 let factCfg = gfc()
833862 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
834863 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
835864 if ((0 > slip))
836865 then throw("Wrong slippage")
837866 else if ((size(i.payments) != 2))
838867 then throw("2 pmnts expd")
839868 else {
840869 let e = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true, false, true, 0, "")
841870 let emitLpAmt = e._2
842871 let lpAssetId = e._7
843872 let state = e._9
844873 let amDiff = e._10
845874 let prDiff = e._11
846875 let amId = e._12
847876 let prId = e._13
848877 let r = invoke(fca, "emit", [emitLpAmt], nil)
849878 if ((r == r))
850879 then {
851880 let el = match r {
852881 case legacy: Address =>
853882 invoke(legacy, "emit", [emitLpAmt], nil)
854883 case _ =>
855884 unit
856885 }
857886 if ((el == el))
858887 then {
859888 let sa = if ((amDiff > 0))
860889 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
861890 else nil
862891 if ((sa == sa))
863892 then {
864893 let sp = if ((prDiff > 0))
865894 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
866895 else nil
867896 if ((sp == sp))
868897 then {
869898 let lpTrnsfr = if (autoStake)
870899 then {
871900 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
872901 if ((ss == ss))
873902 then nil
874903 else throw("Strict value is not equal to itself.")
875904 }
876905 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
877906 (state ++ lpTrnsfr)
878907 }
879908 else throw("Strict value is not equal to itself.")
880909 }
881910 else throw("Strict value is not equal to itself.")
882911 }
883912 else throw("Strict value is not equal to itself.")
884913 }
885914 else throw("Strict value is not equal to itself.")
886915 }
887916 }
888917
889918
890919
891920 @Callable(i)
892921 func putOneTknV2 (minOutAmount,autoStake) = {
893922 let isPoolOneTokenOperationsDisabled = {
894923 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
895924 if ($isInstanceOf(@, "Boolean"))
896925 then @
897926 else throw(($getType(@) + " couldn't be cast to Boolean"))
898927 }
899928 let isPutDisabled = if (if (if (igs())
900929 then true
901930 else (cfgPoolStatus == PoolPutDis))
902931 then true
903932 else (cfgPoolStatus == PoolShutdown))
904933 then true
905934 else isPoolOneTokenOperationsDisabled
906935 let checks = [if (if (!(isPutDisabled))
907936 then true
908937 else isManager(i))
909938 then true
910939 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
911940 then true
912941 else throwErr("exactly 1 payment are expected")]
913942 if ((checks == checks))
914943 then {
915944 let poolConfig = gpc()
916945 let amId = poolConfig[idxAmAsId]
917946 let prId = poolConfig[idxPrAsId]
918947 let lpId = fromBase58String(poolConfig[idxLPAsId])
919948 let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm])
920949 let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm])
921950 let userAddress = if ((i.caller == this))
922951 then i.originCaller
923952 else i.caller
924953 let pmt = value(i.payments[0])
925954 let pmtAssetId = toBase58String(value(pmt.assetId))
926955 let pmtAmt = pmt.amount
927- let $t03334833506 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
928- if (($t03334833506 == $t03334833506))
956+ let $t03464034798 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
957+ if (($t03464034798 == $t03464034798))
929958 then {
930- let feeAmount = $t03334833506._3
931- let state = $t03334833506._2
932- let estimLP = $t03334833506._1
959+ let feeAmount = $t03464034798._3
960+ let state = $t03464034798._2
961+ let estimLP = $t03464034798._1
933962 let emitLpAmt = if (if ((minOutAmount > 0))
934963 then (minOutAmount > estimLP)
935964 else false)
936965 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
937966 else estimLP
938967 let e = invoke(fca, "emit", [emitLpAmt], nil)
939968 if ((e == e))
940969 then {
941970 let el = match e {
942971 case legacy: Address =>
943972 invoke(legacy, "emit", [emitLpAmt], nil)
944973 case _ =>
945974 unit
946975 }
947976 if ((el == el))
948977 then {
949978 let lpTrnsfr = if (autoStake)
950979 then {
951980 let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)])
952981 if ((ss == ss))
953982 then nil
954983 else throw("Strict value is not equal to itself.")
955984 }
956985 else [ScriptTransfer(i.caller, emitLpAmt, lpId)]
957986 let sendFeeToMatcher = if ((feeAmount > 0))
958987 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
959988 else nil
960989 $Tuple2(((state ++ lpTrnsfr) ++ sendFeeToMatcher), emitLpAmt)
961990 }
962991 else throw("Strict value is not equal to itself.")
963992 }
964993 else throw("Strict value is not equal to itself.")
965994 }
966995 else throw("Strict value is not equal to itself.")
967996 }
968997 else throw("Strict value is not equal to itself.")
969998 }
970999
9711000
9721001
9731002 @Callable(i)
9741003 func putForFree (maxSlpg) = if ((0 > maxSlpg))
9751004 then throw("Wrong slpg")
9761005 else if ((size(i.payments) != 2))
9771006 then throw("2 pmnts expd")
9781007 else {
9791008 let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlpg, false, false, true, 0, "")
9801009 estPut._9
9811010 }
9821011
9831012
9841013
9851014 @Callable(i)
9861015 func get () = {
9871016 let r = cg(i)
9881017 let outAmtAmt = r._1
9891018 let outPrAmt = r._2
9901019 let pmtAmt = r._3
9911020 let pmtAssetId = r._4
9921021 let state = r._5
9931022 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
9941023 if ((b == b))
9951024 then state
9961025 else throw("Strict value is not equal to itself.")
9971026 }
9981027
9991028
10001029
10011030 @Callable(i)
10021031 func getOneTknV2 (outAssetId,minOutAmount) = {
10031032 let isPoolOneTokenOperationsDisabled = {
10041033 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
10051034 if ($isInstanceOf(@, "Boolean"))
10061035 then @
10071036 else throw(($getType(@) + " couldn't be cast to Boolean"))
10081037 }
10091038 let isGetDisabled = if (if (igs())
10101039 then true
10111040 else (cfgPoolStatus == PoolShutdown))
10121041 then true
10131042 else isPoolOneTokenOperationsDisabled
10141043 let checks = [if (if (!(isGetDisabled))
10151044 then true
10161045 else isManager(i))
10171046 then true
10181047 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
10191048 then true
10201049 else throwErr("exactly 1 payment are expected")]
10211050 if ((checks == checks))
10221051 then {
1023- let $t03612836283 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1024- let state = $t03612836283._1
1025- let totalAmount = $t03612836283._2
1052+ let $t03742037575 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1053+ let state = $t03742037575._1
1054+ let totalAmount = $t03742037575._2
10261055 $Tuple2(state, totalAmount)
10271056 }
10281057 else throw("Strict value is not equal to itself.")
10291058 }
10301059
10311060
10321061
10331062 @Callable(i)
10341063 func refreshDlp () = nil
10351064
10361065
10371066
10381067 @Callable(i)
10391068 func getOneTknV2READONLY (outAssetId,lpAssetAmount) = {
10401069 let poolConfig = gpc()
10411070 let amId = poolConfig[idxAmAsId]
10421071 let prId = poolConfig[idxPrAsId]
10431072 let lpId = poolConfig[idxLPAsId]
10441073 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
10451074 let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
10461075 let D0 = getD(xp)
10471076 let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission))
10481077 let index = if ((outAssetId == amId))
10491078 then 0
10501079 else if ((outAssetId == prId))
10511080 then 1
10521081 else throw("invalid out asset id")
10531082 let newY = getYD(xp, index, D1)
10541083 let dy = (xp[index] - newY)
10551084 let totalGetRaw = max([0, toInt((dy - big1))])
1056- let $t03712437173 = takeFee(totalGetRaw)
1057- let totalGet = $t03712437173._1
1058- let feeAmount = $t03712437173._2
1085+ let $t03841638465 = takeFee(totalGetRaw)
1086+ let totalGet = $t03841638465._1
1087+ let feeAmount = $t03841638465._2
10591088 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
10601089 }
10611090
10621091
10631092
10641093 @Callable(i)
10651094 func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = {
10661095 let poolConfig = gpc()
10671096 let amId = poolConfig[idxAmAsId]
10681097 let prId = poolConfig[idxPrAsId]
10691098 let lpId = poolConfig[idxLPAsId]
10701099 let amBalance = getAccBalance(amId)
10711100 let prBalance = getAccBalance(prId)
1072- let $t03751837633 = {
1101+ let $t03881038925 = {
10731102 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
10741103 if ($isInstanceOf(@, "(Int, Int)"))
10751104 then @
10761105 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
10771106 }
1078- let totalGet = $t03751837633._1
1079- let feeAmount = $t03751837633._2
1107+ let totalGet = $t03881038925._1
1108+ let feeAmount = $t03881038925._2
10801109 let r = ego("", lpId, lpAssetAmount, this)
10811110 let outAmAmt = r._1
10821111 let outPrAmt = r._2
10831112 let sumOfGetAssets = (outAmAmt + outPrAmt)
10841113 let bonus = if ((sumOfGetAssets == 0))
10851114 then if ((totalGet == 0))
10861115 then 0
10871116 else throw("bonus calculation error")
10881117 else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets)
10891118 $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus))
10901119 }
10911120
10921121
10931122
10941123 @Callable(i)
10951124 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
10961125 let r = cg(i)
10971126 let outAmAmt = r._1
10981127 let outPrAmt = r._2
10991128 let pmtAmt = r._3
11001129 let pmtAssetId = r._4
11011130 let state = r._5
11021131 if ((noLessThenAmtAsset > outAmAmt))
11031132 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
11041133 else if ((noLessThenPriceAsset > outPrAmt))
11051134 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
11061135 else {
11071136 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11081137 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11091138 then state
11101139 else throw("Strict value is not equal to itself.")
11111140 }
11121141 }
11131142
11141143
11151144
11161145 @Callable(i)
11171146 func unstakeAndGet (amount) = {
11181147 let checkPayments = if ((size(i.payments) != 0))
11191148 then throw("No pmnts expd")
11201149 else true
11211150 if ((checkPayments == checkPayments))
11221151 then {
11231152 let cfg = gpc()
11241153 let factoryCfg = gfc()
11251154 let lpAssetId = fromBase58String(cfg[idxLPAsId])
11261155 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
11271156 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
11281157 if ((unstakeInv == unstakeInv))
11291158 then {
11301159 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11311160 let sts = parseIntValue(r._9)
11321161 let state = r._10
11331162 let v = if (if (igs())
11341163 then true
11351164 else (sts == PoolShutdown))
11361165 then throw(("Blocked: " + toString(sts)))
11371166 else true
11381167 if ((v == v))
11391168 then {
11401169 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11411170 if ((burnA == burnA))
11421171 then state
11431172 else throw("Strict value is not equal to itself.")
11441173 }
11451174 else throw("Strict value is not equal to itself.")
11461175 }
11471176 else throw("Strict value is not equal to itself.")
11481177 }
11491178 else throw("Strict value is not equal to itself.")
11501179 }
11511180
11521181
11531182
11541183 @Callable(i)
11551184 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11561185 let isGetDisabled = if (igs())
11571186 then true
11581187 else (cfgPoolStatus == PoolShutdown)
11591188 let checks = [if (!(isGetDisabled))
11601189 then true
11611190 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11621191 then true
11631192 else throw("no payments are expected")]
11641193 if ((checks == checks))
11651194 then {
11661195 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11671196 if ((unstakeInv == unstakeInv))
11681197 then {
11691198 let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11701199 let outAmAmt = res._1
11711200 let outPrAmt = res._2
11721201 let state = res._10
11731202 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
11741203 then true
11751204 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
11761205 then true
11771206 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
11781207 if ((checkAmounts == checkAmounts))
11791208 then {
11801209 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11811210 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11821211 then state
11831212 else throw("Strict value is not equal to itself.")
11841213 }
11851214 else throw("Strict value is not equal to itself.")
11861215 }
11871216 else throw("Strict value is not equal to itself.")
11881217 }
11891218 else throw("Strict value is not equal to itself.")
11901219 }
11911220
11921221
11931222
11941223 @Callable(i)
11951224 func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = {
11961225 let isPoolOneTokenOperationsDisabled = {
11971226 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11981227 if ($isInstanceOf(@, "Boolean"))
11991228 then @
12001229 else throw(($getType(@) + " couldn't be cast to Boolean"))
12011230 }
12021231 let isGetDisabled = if (if (igs())
12031232 then true
12041233 else (cfgPoolStatus == PoolShutdown))
12051234 then true
12061235 else isPoolOneTokenOperationsDisabled
12071236 let checks = [if (if (!(isGetDisabled))
12081237 then true
12091238 else isManager(i))
12101239 then true
12111240 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
12121241 then true
12131242 else throwErr("no payments are expected")]
12141243 if ((checks == checks))
12151244 then {
12161245 let cfg = gpc()
12171246 let factoryCfg = gfc()
12181247 let lpAssetId = fromBase58String(cfg[idxLPAsId])
12191248 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
12201249 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil)
12211250 if ((unstakeInv == unstakeInv))
12221251 then {
1223- let $t04147141659 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1224- let state = $t04147141659._1
1225- let totalAmount = $t04147141659._2
1252+ let $t04276342951 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1253+ let state = $t04276342951._1
1254+ let totalAmount = $t04276342951._2
12261255 $Tuple2(state, totalAmount)
12271256 }
12281257 else throw("Strict value is not equal to itself.")
12291258 }
12301259 else throw("Strict value is not equal to itself.")
12311260 }
12321261
12331262
12341263
12351264 @Callable(i)
12361265 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
12371266 let poolConfig = gpc()
12381267 let amId = poolConfig[idxAmAsId]
12391268 let prId = poolConfig[idxPrAsId]
12401269 let lpId = poolConfig[idxLPAsId]
1241- let $t04191842021 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1242- let lpAmount = $t04191842021._1
1243- let state = $t04191842021._2
1244- let feeAmount = $t04191842021._3
1245- let bonus = $t04191842021._4
1270+ let $t04321043313 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1271+ let lpAmount = $t04321043313._1
1272+ let state = $t04321043313._2
1273+ let feeAmount = $t04321043313._3
1274+ let bonus = $t04321043313._4
12461275 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
12471276 }
12481277
12491278
12501279
12511280 @Callable(i)
12521281 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
12531282 let poolConfig = gpc()
12541283 let amId = poolConfig[idxAmAsId]
12551284 let prId = poolConfig[idxPrAsId]
12561285 let lpId = poolConfig[idxLPAsId]
1257- let $t04230042404 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1258- let lpAmount = $t04230042404._1
1259- let state = $t04230042404._2
1260- let feeAmount = $t04230042404._3
1261- let bonus = $t04230042404._4
1286+ let $t04359243696 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1287+ let lpAmount = $t04359243696._1
1288+ let state = $t04359243696._2
1289+ let feeAmount = $t04359243696._3
1290+ let bonus = $t04359243696._4
12621291 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
12631292 }
12641293
12651294
12661295
12671296 @Callable(i)
12681297 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
12691298 then throw("denied")
12701299 else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
12711300
12721301
12731302
12741303 @Callable(i)
12751304 func setS (k,v) = if ((toString(i.caller) != strf(this, ada())))
12761305 then pd
12771306 else [StringEntry(k, v)]
12781307
12791308
12801309
12811310 @Callable(i)
12821311 func setI (k,v) = if ((toString(i.caller) != strf(this, ada())))
12831312 then pd
12841313 else [IntegerEntry(k, v)]
12851314
12861315
12871316
12881317 @Callable(i)
12891318 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
12901319
12911320
12921321
12931322 @Callable(i)
12941323 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12951324
12961325
12971326
12981327 @Callable(i)
12991328 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
13001329 let pr = calcPrices(amAmt, prAmt, lpAmt)
13011330 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
13021331 }
13031332
13041333
13051334
13061335 @Callable(i)
13071336 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
13081337
13091338
13101339
13111340 @Callable(i)
13121341 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
13131342
13141343
13151344
13161345 @Callable(i)
13171346 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
13181347
13191348
13201349
13211350 @Callable(i)
13221351 func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, true, false, 0, ""))
13231352
13241353
13251354
13261355 @Callable(i)
13271356 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
13281357 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
13291358 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
13301359 }
13311360
13321361
13331362
13341363 @Callable(i)
13351364 func getFeeREADONLY () = $Tuple2(nil, fee)
13361365
13371366
13381367 @Verifier(tx)
13391368 func verify () = {
13401369 let targetPublicKey = match m() {
13411370 case pk: ByteVector =>
13421371 pk
13431372 case _: Unit =>
13441373 tx.senderPublicKey
13451374 case _ =>
13461375 throw("Match error")
13471376 }
13481377 match tx {
13491378 case order: Order =>
13501379 let matcherPub = mp()
13511380 let orderValid = moa(order)
13521381 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
13531382 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
13541383 if (if (if (orderValid)
13551384 then senderValid
13561385 else false)
13571386 then matcherValid
13581387 else false)
13591388 then true
13601389 else toe(orderValid, senderValid, matcherValid)
13611390 case s: SetScriptTransaction =>
13621391 let newHash = blake2b256(value(s.script))
13631392 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
13641393 let currentHash = scriptHash(this)
13651394 if (if ((allowedHash == newHash))
13661395 then (currentHash != newHash)
13671396 else false)
13681397 then true
13691398 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13701399 case _ =>
13711400 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13721401 }
13731402 }
13741403

github/deemru/w8io/169f3d6 
166.63 ms