tx · BMMqky43XN1xe4eQYJAmZqYu5cJsnUtqggSBDNB4DLqA 3N8sfbgCJCsLbcWYRiVKm6ivccPLMsQmVDx: -0.02800000 Waves 2022.10.14 09:11 [2271649] smart account 3N8sfbgCJCsLbcWYRiVKm6ivccPLMsQmVDx > SELF 0.00000000 Waves
{ "type": 13, "id": "BMMqky43XN1xe4eQYJAmZqYu5cJsnUtqggSBDNB4DLqA", "fee": 2800000, "feeAssetId": null, "timestamp": 1665727859380, "version": 1, "sender": "3N8sfbgCJCsLbcWYRiVKm6ivccPLMsQmVDx", "senderPublicKey": "G4Ha5wvhDpHGy5koVJsmfWC2zwF89jXDUmWBb28mRyrr", "proofs": [ "jYnvECccrGkyLP2gjY2QrgVnyDj7vgv27eNoaK1gAa4sSQJrzQwev2dTfQAzJNxpPLxy6ffAV69HGvNCJ1s1DBx" ], "script": "base64:BgKOJwgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAgEIEgUKAwgBARIECgIIARIAEgQKAgEBEgMKAQESBAoCCAgSABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXNzZXREY20iEmlkeFBvb2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JjegJfOQkAlAoCBQNuaWwJALkJAgkAzAgCAg4lZCVkJWQlZCVkJWQlZAkAzAgCCQCkAwEFAmNmCQDMCAIJAKQDAQUCY2cJAMwIAgkApAMBBQJiVgkAzAgCCQCkAwEFAmJYCQDMCAIJAKQDAQUCYlUJAMwIAgkApgMBBQJjYQkAzAgCCQCkAwEFAmJUBQNuaWwFAWoBAmZHAQJmSAAEAmZJBAJkcAkBAmVBAAMJAAECBQJkcAIKQnl0ZVZlY3RvcgQCZUYFAmRwBQJlRgMJAAECBQJkcAIEVW5pdAgFAmZHD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yBAJkcAUCZkcDCQABAgUCZHACBU9yZGVyBAJjUQUCZHAEAmZKCQECYUYABAJhdAkBAmNQAQUCY1EEAmF1CQD0AwMIBQJjUQlib2R5Qnl0ZXMJAJEDAggFAmNRBnByb29mcwAACAUCY1EPc2VuZGVyUHVibGljS2V5BAJhdgkA9AMDCAUCY1EJYm9keUJ5dGVzCQCRAwIIBQJjUQZwcm9vZnMAAQUCZkoDAwMFAmF0BQJhdQcFAmF2BwYJAQJhcwMFAmF0BQJhdQUCYXYDCQABAgUCZHACFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJlQgUCZHAEAmZLCQD2AwEJAQV2YWx1ZQEIBQJlQgZzY3JpcHQEAmZMCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYUMJAQJhcQAEAmZNCQDxBwEFBHRoaXMDAwkAAAIFAmZMBQJmSwkBAiE9AgUCZk0FAmZLBwYJAPQDAwgFAmZHCWJvZHlCeXRlcwkAkQMCCAUCZkcGcHJvb2ZzAAAFAmZJCQD0AwMIBQJmRwlib2R5Qnl0ZXMJAJEDAggFAmZHBnByb29mcwAABQJmSdC3Loo=", "chainId": 84, "height": 2271649, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EBKuFR45juc6kPcFZmfN3ipMbTco6kg5RZQq6niKwoDB Next: AEd7EP96MyVp5hbnnKVkKog9X9mS47CAncKyJrrGJoAz Diff:
Old | New | Differences | |
---|---|---|---|
175 | 175 | ||
176 | 176 | 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])) | |
177 | 177 | ||
178 | + | ||
179 | + | let poolConfigParsed = parsePoolConfig(getPoolConfig()) | |
180 | + | ||
181 | + | let $t074847650 = poolConfigParsed | |
182 | + | ||
183 | + | let cfgPoolAddress = $t074847650._1 | |
184 | + | ||
185 | + | let cfgPoolStatus = $t074847650._2 | |
186 | + | ||
187 | + | let cfgLpAssetId = $t074847650._3 | |
188 | + | ||
189 | + | let cfgAmountAssetId = $t074847650._4 | |
190 | + | ||
191 | + | let cfgPriceAssetId = $t074847650._5 | |
192 | + | ||
193 | + | let cfgAmountAssetDecimals = $t074847650._6 | |
194 | + | ||
195 | + | let cfgPriceAssetDecimals = $t074847650._7 | |
178 | 196 | ||
179 | 197 | func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP) | |
180 | 198 | ||
444 | 462 | ||
445 | 463 | func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = { | |
446 | 464 | let isEval = (txId == unit) | |
447 | - | let $ | |
448 | - | let poolAddress = $ | |
449 | - | let poolStatus = $ | |
450 | - | let lpAssetId = $ | |
451 | - | let amountAssetId = $ | |
452 | - | let priceAssetId = $ | |
453 | - | let amountAssetDecimals = $ | |
454 | - | let priceAssetDecimals = $ | |
465 | + | let $t02216722345 = parsePoolConfig(getPoolConfig()) | |
466 | + | let poolAddress = $t02216722345._1 | |
467 | + | let poolStatus = $t02216722345._2 | |
468 | + | let lpAssetId = $t02216722345._3 | |
469 | + | let amountAssetId = $t02216722345._4 | |
470 | + | let priceAssetId = $t02216722345._5 | |
471 | + | let amountAssetDecimals = $t02216722345._6 | |
472 | + | let priceAssetDecimals = $t02216722345._7 | |
455 | 473 | let amountBalanceRaw = getAccBalance(assetIdToString(amountAssetId)) | |
456 | 474 | let priceBalanceRaw = getAccBalance(assetIdToString(priceAssetId)) | |
457 | 475 | let paymentInAmountAsset = if ((paymentAssetId == amountAssetId)) | |
459 | 477 | else if ((paymentAssetId == priceAssetId)) | |
460 | 478 | then false | |
461 | 479 | else throwErr("invalid asset") | |
462 | - | let $ | |
480 | + | let $t02267522968 = if (isEval) | |
463 | 481 | then $Tuple2(amountBalanceRaw, priceBalanceRaw) | |
464 | 482 | else if (paymentInAmountAsset) | |
465 | 483 | then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw) | |
466 | 484 | else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw)) | |
467 | - | let amountBalanceOld = $ | |
468 | - | let priceBalanceOld = $ | |
469 | - | let $ | |
485 | + | let amountBalanceOld = $t02267522968._1 | |
486 | + | let priceBalanceOld = $t02267522968._2 | |
487 | + | let $t02297223121 = if (paymentInAmountAsset) | |
470 | 488 | then $Tuple2(paymentAmountRaw, 0) | |
471 | 489 | else $Tuple2(0, paymentAmountRaw) | |
472 | - | let amountAssetAmountRaw = $ | |
473 | - | let priceAssetAmountRaw = $ | |
490 | + | let amountAssetAmountRaw = $t02297223121._1 | |
491 | + | let priceAssetAmountRaw = $t02297223121._2 | |
474 | 492 | let amountAssetAmount = takeFee(amountAssetAmountRaw)._1 | |
475 | 493 | let priceAssetAmount = takeFee(priceAssetAmountRaw)._1 | |
476 | - | let $ | |
477 | - | let paymentAmount = $ | |
478 | - | let feeAmount = $ | |
494 | + | let $t02324323302 = takeFee(paymentAmountRaw) | |
495 | + | let paymentAmount = $t02324323302._1 | |
496 | + | let feeAmount = $t02324323302._2 | |
479 | 497 | let amountBalanceNew = (amountBalanceOld + amountAssetAmount) | |
480 | 498 | let priceBalanceNew = (priceBalanceOld + priceAssetAmount) | |
481 | 499 | let curPrice = fromX18(calcPriceBigInt(toX18(priceBalanceNew, priceAssetDecimals), toX18(amountBalanceNew, amountAssetDecimals)), scale8) | |
507 | 525 | ||
508 | 526 | func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = { | |
509 | 527 | let isEval = (txId == unit) | |
510 | - | let $ | |
511 | - | let poolAddress = $ | |
512 | - | let poolStatus = $ | |
513 | - | let lpAssetId = $ | |
514 | - | let amountAssetId = $ | |
515 | - | let priceAssetId = $ | |
516 | - | let amDecimals = $ | |
517 | - | let prDecimals = $ | |
528 | + | let $t02525225413 = parsePoolConfig(getPoolConfig()) | |
529 | + | let poolAddress = $t02525225413._1 | |
530 | + | let poolStatus = $t02525225413._2 | |
531 | + | let lpAssetId = $t02525225413._3 | |
532 | + | let amountAssetId = $t02525225413._4 | |
533 | + | let priceAssetId = $t02525225413._5 | |
534 | + | let amDecimals = $t02525225413._6 | |
535 | + | let prDecimals = $t02525225413._7 | |
518 | 536 | let checks = [if ((paymentAssetId == lpAssetId)) | |
519 | 537 | then true | |
520 | 538 | else throw("invalid lp asset")] | |
537 | 555 | let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity) | |
538 | 556 | let redeemedBigInt = toBigInt(paymentAmount) | |
539 | 557 | let amountRaw = toInt(((balanceBigInt * (scale8BigInt - pow((scale8BigInt - ((redeemedBigInt * scale8BigInt) / supplyBigInt)), 8, big2, 0, 8, DOWN))) / scale8BigInt)) | |
540 | - | let $ | |
541 | - | let totalAmount = $ | |
542 | - | let feeAmount = $ | |
543 | - | let $ | |
558 | + | let $t02648026530 = takeFee(amountRaw) | |
559 | + | let totalAmount = $t02648026530._1 | |
560 | + | let feeAmount = $t02648026530._2 | |
561 | + | let $t02653426760 = if (outInAmountAsset) | |
544 | 562 | then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld) | |
545 | 563 | else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw)) | |
546 | - | let outAmAmount = $ | |
547 | - | let outPrAmount = $ | |
548 | - | let amBalanceNew = $ | |
549 | - | let prBalanceNew = $ | |
564 | + | let outAmAmount = $t02653426760._1 | |
565 | + | let outPrAmount = $t02653426760._2 | |
566 | + | let amBalanceNew = $t02653426760._3 | |
567 | + | let prBalanceNew = $t02653426760._4 | |
550 | 568 | let curPrX18 = calcPriceBigInt(toX18(prBalanceNew, prDecimals), toX18(amBalanceNew, amDecimals)) | |
551 | 569 | let curPrice = fromX18(curPrX18, scale8) | |
552 | 570 | let commonState = if (isEval) | |
699 | 717 | ||
700 | 718 | @Callable(i) | |
701 | 719 | func putOneTkn (minOutAmount,autoStake) = { | |
702 | - | let $t03042630604 = parsePoolConfig(getPoolConfig()) | |
703 | - | let poolAddress = $t03042630604._1 | |
704 | - | let poolStatus = $t03042630604._2 | |
705 | - | let lpAssetId = $t03042630604._3 | |
706 | - | let amountAssetId = $t03042630604._4 | |
707 | - | let priceAssetId = $t03042630604._5 | |
708 | - | let amountAssetDecimals = $t03042630604._6 | |
709 | - | let priceAssetDecimals = $t03042630604._7 | |
710 | 720 | let isPutDisabled = if (if (isGlobalShutdown()) | |
711 | 721 | then true | |
712 | - | else ( | |
722 | + | else (cfgPoolStatus == PoolPutDisabled)) | |
713 | 723 | then true | |
714 | - | else ( | |
724 | + | else (cfgPoolStatus == PoolShutdown) | |
715 | 725 | let checks = [if (!(isPutDisabled)) | |
716 | 726 | then true | |
717 | 727 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
722 | 732 | let payment = i.payments[0] | |
723 | 733 | let paymentAssetId = payment.assetId | |
724 | 734 | let paymentAmountRaw = payment.amount | |
725 | - | let paymentAmount = paymentAmountRaw | |
726 | 735 | let userAddress = i.caller | |
727 | 736 | let txId = i.transactionId | |
728 | - | let $ | |
729 | - | let emitAmountEstimated = $ | |
730 | - | let commonState = $ | |
731 | - | let feeAmount = $ | |
732 | - | let bonus = $ | |
737 | + | let $t03110131228 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId) | |
738 | + | let emitAmountEstimated = $t03110131228._1 | |
739 | + | let commonState = $t03110131228._2 | |
740 | + | let feeAmount = $t03110131228._3 | |
741 | + | let bonus = $t03110131228._4 | |
733 | 742 | let emitAmount = if (if ((minOutAmount > 0)) | |
734 | 743 | then (minOutAmount > emitAmountEstimated) | |
735 | 744 | else false) | |
740 | 749 | then { | |
741 | 750 | let lpTransfer = if (autoStake) | |
742 | 751 | then { | |
743 | - | let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment( | |
752 | + | let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)]) | |
744 | 753 | if ((stakeInv == stakeInv)) | |
745 | 754 | then nil | |
746 | 755 | else throw("Strict value is not equal to itself.") | |
747 | 756 | } | |
748 | - | else [ScriptTransfer(i.caller, emitAmount, | |
757 | + | else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)] | |
749 | 758 | let sendFee = if ((feeAmount > 0)) | |
750 | 759 | then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)] | |
751 | 760 | else nil | |
759 | 768 | ||
760 | 769 | ||
761 | 770 | @Callable(i) | |
771 | + | func putOneTknREADONLY (paymentAmountRaw,paymentAssetId) = { | |
772 | + | let $t03195432089 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit) | |
773 | + | let emitAmountEstimated = $t03195432089._1 | |
774 | + | let commonState = $t03195432089._2 | |
775 | + | let feeAmount = $t03195432089._3 | |
776 | + | let bonus = $t03195432089._4 | |
777 | + | $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus)) | |
778 | + | } | |
779 | + | ||
780 | + | ||
781 | + | ||
782 | + | @Callable(i) | |
762 | 783 | func getOneTkn (outAssetId,minOutAmount,unstakeAmount) = { | |
763 | - | let $t03194232120 = parsePoolConfig(getPoolConfig()) | |
764 | - | let poolAddress = $t03194232120._1 | |
765 | - | let poolStatus = $t03194232120._2 | |
766 | - | let lpAssetId = $t03194232120._3 | |
767 | - | let amountAssetId = $t03194232120._4 | |
768 | - | let priceAssetId = $t03194232120._5 | |
769 | - | let amountAssetDecimals = $t03194232120._6 | |
770 | - | let priceAssetDecimals = $t03194232120._7 | |
771 | 784 | let isGetDisabled = if (isGlobalShutdown()) | |
772 | 785 | then true | |
773 | - | else ( | |
786 | + | else (cfgPoolStatus == PoolShutdown) | |
774 | 787 | let checks = [if (!(isGetDisabled)) | |
775 | 788 | then true | |
776 | 789 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
783 | 796 | let paymentAmount = payment.amount | |
784 | 797 | let userAddress = i.caller | |
785 | 798 | let txId = i.transactionId | |
786 | - | let $ | |
787 | - | let amountEstimated = $ | |
788 | - | let commonState = $ | |
789 | - | let feeAmount = $ | |
790 | - | let bonus = $ | |
799 | + | let $t03264532792 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, paymentAssetId, userAddress, txId) | |
800 | + | let amountEstimated = $t03264532792._1 | |
801 | + | let commonState = $t03264532792._2 | |
802 | + | let feeAmount = $t03264532792._3 | |
803 | + | let bonus = $t03264532792._4 | |
791 | 804 | let amount = if (if ((minOutAmount > 0)) | |
792 | 805 | then (minOutAmount > amountEstimated) | |
793 | 806 | else false) | |
802 | 815 | else throw("Strict value is not equal to itself.") | |
803 | 816 | } | |
804 | 817 | else throw("Strict value is not equal to itself.") | |
818 | + | } | |
819 | + | ||
820 | + | ||
821 | + | ||
822 | + | @Callable(i) | |
823 | + | func getOneTknREADONLY (outAssetId,paymentAmount) = { | |
824 | + | let $t03330333441 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit) | |
825 | + | let amountEstimated = $t03330333441._1 | |
826 | + | let commonState = $t03330333441._2 | |
827 | + | let feeAmount = $t03330333441._3 | |
828 | + | let bonus = $t03330333441._4 | |
829 | + | $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus)) | |
805 | 830 | } | |
806 | 831 | ||
807 | 832 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lPdecimals = 8 | |
5 | 5 | ||
6 | 6 | let scale8 = 100000000 | |
7 | 7 | ||
8 | 8 | let scale8BigInt = toBigInt(100000000) | |
9 | 9 | ||
10 | 10 | let scale18 = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let zeroBigInt = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let big0 = toBigInt(0) | |
15 | 15 | ||
16 | 16 | let big1 = toBigInt(1) | |
17 | 17 | ||
18 | 18 | let big2 = toBigInt(2) | |
19 | 19 | ||
20 | 20 | let wavesString = "WAVES" | |
21 | 21 | ||
22 | 22 | let SEP = "__" | |
23 | 23 | ||
24 | 24 | let PoolActive = 1 | |
25 | 25 | ||
26 | 26 | let PoolPutDisabled = 2 | |
27 | 27 | ||
28 | 28 | let PoolMatcherDisabled = 3 | |
29 | 29 | ||
30 | 30 | let PoolShutdown = 4 | |
31 | 31 | ||
32 | 32 | let idxPoolAddress = 1 | |
33 | 33 | ||
34 | 34 | let idxPoolStatus = 2 | |
35 | 35 | ||
36 | 36 | let idxPoolLPAssetId = 3 | |
37 | 37 | ||
38 | 38 | let idxAmtAssetId = 4 | |
39 | 39 | ||
40 | 40 | let idxPriceAssetId = 5 | |
41 | 41 | ||
42 | 42 | let idxAmtAssetDcm = 6 | |
43 | 43 | ||
44 | 44 | let idxPriceAssetDcm = 7 | |
45 | 45 | ||
46 | 46 | let idxIAmtAssetId = 8 | |
47 | 47 | ||
48 | 48 | let idxIPriceAssetId = 9 | |
49 | 49 | ||
50 | 50 | let idxLPAssetDcm = 10 | |
51 | 51 | ||
52 | 52 | let idxPoolAmtAssetAmt = 1 | |
53 | 53 | ||
54 | 54 | let idxPoolPriceAssetAmt = 2 | |
55 | 55 | ||
56 | 56 | let idxPoolLPAssetAmt = 3 | |
57 | 57 | ||
58 | 58 | let idxFactoryStakingContract = 1 | |
59 | 59 | ||
60 | 60 | let idxFactorySlippageContract = 7 | |
61 | 61 | ||
62 | 62 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func abs (val) = if ((zeroBigInt > val)) | |
72 | 72 | then -(val) | |
73 | 73 | else val | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func fc () = "%s__factoryContract" | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func mpk () = "%s__managerPublicKey" | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func pmpk () = "%s__pendingManagerPublicKey" | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func pl () = "%s%s__price__last" | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func aa () = "%s__amountAsset" | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func pa () = "%s__priceAsset" | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | let keyFee = "%s__fee" | |
104 | 104 | ||
105 | 105 | let feeDefault = fraction(5, scale8, 10000) | |
106 | 106 | ||
107 | 107 | let fee = valueOrElse(getInteger(this, keyFee), feeDefault) | |
108 | 108 | ||
109 | 109 | func keyFactoryConfig () = "%s__factoryConfig" | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func keyMatcherPub () = "%s%s__matcher__publicKey" | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config") | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func keyAllPoolsShutdown () = "%s__shutdown" | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash" | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | let keyFeeCollectorAddress = "%s__feeCollectorAddress" | |
134 | 134 | ||
135 | 135 | func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid))) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func throwErr (msg) = throw(makeString(["lp.ride:", msg], " ")) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | let factoryContract = addressFromStringValue(getStringOrFail(this, fc())) | |
148 | 148 | ||
149 | 149 | let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress)) | |
150 | 150 | ||
151 | 151 | func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub())) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func getPoolConfig () = { | |
158 | 158 | let amtAsset = getStringOrFail(this, aa()) | |
159 | 159 | let priceAsset = getStringOrFail(this, pa()) | |
160 | 160 | let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset)) | |
161 | 161 | let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset)) | |
162 | 162 | split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP) | |
163 | 163 | } | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func parseAssetId (input) = if ((input == wavesString)) | |
167 | 167 | then unit | |
168 | 168 | else fromBase58String(input) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func assetIdToString (input) = if ((input == unit)) | |
172 | 172 | then wavesString | |
173 | 173 | else toBase58String(value(input)) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | 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])) | |
177 | 177 | ||
178 | + | ||
179 | + | let poolConfigParsed = parsePoolConfig(getPoolConfig()) | |
180 | + | ||
181 | + | let $t074847650 = poolConfigParsed | |
182 | + | ||
183 | + | let cfgPoolAddress = $t074847650._1 | |
184 | + | ||
185 | + | let cfgPoolStatus = $t074847650._2 | |
186 | + | ||
187 | + | let cfgLpAssetId = $t074847650._3 | |
188 | + | ||
189 | + | let cfgAmountAssetId = $t074847650._4 | |
190 | + | ||
191 | + | let cfgPriceAssetId = $t074847650._5 | |
192 | + | ||
193 | + | let cfgAmountAssetDecimals = $t074847650._6 | |
194 | + | ||
195 | + | let cfgPriceAssetDecimals = $t074847650._7 | |
178 | 196 | ||
179 | 197 | func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP) | |
180 | 198 | ||
181 | 199 | ||
182 | 200 | let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address") | |
183 | 201 | ||
184 | 202 | let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address") | |
185 | 203 | ||
186 | 204 | 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) | |
187 | 205 | ||
188 | 206 | ||
189 | 207 | 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) | |
190 | 208 | ||
191 | 209 | ||
192 | 210 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
193 | 211 | then wavesBalance(this).available | |
194 | 212 | else assetBalance(this, fromBase58String(assetId)) | |
195 | 213 | ||
196 | 214 | ||
197 | 215 | func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
198 | 216 | ||
199 | 217 | ||
200 | 218 | func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
201 | 219 | let amtAssetAmtX18 = toX18(amAmt, amAssetDcm) | |
202 | 220 | let priceAssetAmtX18 = toX18(prAmt, prAssetDcm) | |
203 | 221 | calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
204 | 222 | } | |
205 | 223 | ||
206 | 224 | ||
207 | 225 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
208 | 226 | let cfg = getPoolConfig() | |
209 | 227 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
210 | 228 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
211 | 229 | let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt) | |
212 | 230 | let amAmtX18 = toX18(amAmt, amtAssetDcm) | |
213 | 231 | let prAmtX18 = toX18(prAmt, priceAssetDcm) | |
214 | 232 | let lpAmtX18 = toX18(lpAmt, scale8) | |
215 | 233 | let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18) | |
216 | 234 | let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18) | |
217 | 235 | [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18] | |
218 | 236 | } | |
219 | 237 | ||
220 | 238 | ||
221 | 239 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
222 | 240 | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
223 | 241 | [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)] | |
224 | 242 | } | |
225 | 243 | ||
226 | 244 | ||
227 | 245 | func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
228 | 246 | let cfg = getPoolConfig() | |
229 | 247 | let lpAssetId = cfg[idxPoolLPAssetId] | |
230 | 248 | let amAssetId = cfg[idxAmtAssetId] | |
231 | 249 | let prAssetId = cfg[idxPriceAssetId] | |
232 | 250 | let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
233 | 251 | let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
234 | 252 | let poolStatus = cfg[idxPoolStatus] | |
235 | 253 | let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity | |
236 | 254 | if ((lpAssetId != pmtAssetId)) | |
237 | 255 | then throw("Invalid asset passed.") | |
238 | 256 | else { | |
239 | 257 | let amBalance = getAccBalance(amAssetId) | |
240 | 258 | let amBalanceX18 = toX18(amBalance, amAssetDcm) | |
241 | 259 | let prBalance = getAccBalance(prAssetId) | |
242 | 260 | let prBalanceX18 = toX18(prBalance, prAssetDcm) | |
243 | 261 | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
244 | 262 | let curPrice = fromX18(curPriceX18, scale8) | |
245 | 263 | let pmtLpAmtX18 = toX18(pmtLpAmt, scale8) | |
246 | 264 | let lpEmissionX18 = toX18(lpEmission, scale8) | |
247 | 265 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
248 | 266 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
249 | 267 | let outAmAmt = fromX18(outAmAmtX18, amAssetDcm) | |
250 | 268 | let outPrAmt = fromX18(outPrAmtX18, prAssetDcm) | |
251 | 269 | let state = if ((txId58 == "")) | |
252 | 270 | then nil | |
253 | 271 | else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES")) | |
254 | 272 | then unit | |
255 | 273 | else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES")) | |
256 | 274 | then unit | |
257 | 275 | 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)] | |
258 | 276 | $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state) | |
259 | 277 | } | |
260 | 278 | } | |
261 | 279 | ||
262 | 280 | ||
263 | 281 | func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = { | |
264 | 282 | let cfg = getPoolConfig() | |
265 | 283 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
266 | 284 | let amAssetIdStr = cfg[idxAmtAssetId] | |
267 | 285 | let prAssetIdStr = cfg[idxPriceAssetId] | |
268 | 286 | let iAmtAssetId = cfg[idxIAmtAssetId] | |
269 | 287 | let iPriceAssetId = cfg[idxIPriceAssetId] | |
270 | 288 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
271 | 289 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
272 | 290 | let poolStatus = cfg[idxPoolStatus] | |
273 | 291 | let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
274 | 292 | let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES"))) | |
275 | 293 | let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES"))) | |
276 | 294 | if (if ((amAssetIdStr != inAmAssetIdStr)) | |
277 | 295 | then true | |
278 | 296 | else (prAssetIdStr != inPrAssetIdStr)) | |
279 | 297 | then throw("Invalid amt or price asset passed.") | |
280 | 298 | else { | |
281 | 299 | let amBalance = if (isEvaluate) | |
282 | 300 | then getAccBalance(amAssetIdStr) | |
283 | 301 | else (getAccBalance(amAssetIdStr) - inAmAssetAmt) | |
284 | 302 | let prBalance = if (isEvaluate) | |
285 | 303 | then getAccBalance(prAssetIdStr) | |
286 | 304 | else (getAccBalance(prAssetIdStr) - inPrAssetAmt) | |
287 | 305 | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
288 | 306 | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
289 | 307 | let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18) | |
290 | 308 | let amBalanceX18 = toX18(amBalance, amtAssetDcm) | |
291 | 309 | let prBalanceX18 = toX18(prBalance, priceAssetDcm) | |
292 | 310 | let res = if ((lpEmission == 0)) | |
293 | 311 | then { | |
294 | 312 | let curPriceX18 = zeroBigInt | |
295 | 313 | let slippageX18 = zeroBigInt | |
296 | 314 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
297 | 315 | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
298 | 316 | } | |
299 | 317 | else { | |
300 | 318 | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
301 | 319 | let slippageX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
302 | 320 | let slippageToleranceX18 = toX18(slippageTolerance, scale8) | |
303 | 321 | if (if ((curPriceX18 != zeroBigInt)) | |
304 | 322 | then (slippageX18 > slippageToleranceX18) | |
305 | 323 | else false) | |
306 | 324 | then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18))) | |
307 | 325 | else { | |
308 | 326 | let lpEmissionX18 = toX18(lpEmission, scale8) | |
309 | 327 | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
310 | 328 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
311 | 329 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
312 | 330 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
313 | 331 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
314 | 332 | let expAmtAssetAmtX18 = expectedAmts._1 | |
315 | 333 | let expPriceAssetAmtX18 = expectedAmts._2 | |
316 | 334 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
317 | 335 | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18) | |
318 | 336 | } | |
319 | 337 | } | |
320 | 338 | let calcLpAmt = res._1 | |
321 | 339 | let calcAmAssetPmt = res._2 | |
322 | 340 | let calcPrAssetPmt = res._3 | |
323 | 341 | let curPrice = fromX18(res._4, scale8) | |
324 | 342 | let slippageCalc = fromX18(res._5, scale8) | |
325 | 343 | if ((0 >= calcLpAmt)) | |
326 | 344 | then throw("Invalid calculations. LP calculated is less than zero.") | |
327 | 345 | else { | |
328 | 346 | let emitLpAmt = if (!(emitLp)) | |
329 | 347 | then 0 | |
330 | 348 | else calcLpAmt | |
331 | 349 | let amDiff = (inAmAssetAmt - calcAmAssetPmt) | |
332 | 350 | let prDiff = (inPrAssetAmt - calcPrAssetPmt) | |
333 | 351 | 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))] | |
334 | 352 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId) | |
335 | 353 | } | |
336 | 354 | } | |
337 | 355 | } | |
338 | 356 | ||
339 | 357 | ||
340 | 358 | func validateMatcherOrderAllowed (order) = { | |
341 | 359 | let cfg = getPoolConfig() | |
342 | 360 | let amtAssetId = cfg[idxAmtAssetId] | |
343 | 361 | let priceAssetId = cfg[idxPriceAssetId] | |
344 | 362 | let poolStatus = parseIntValue(cfg[idxPoolStatus]) | |
345 | 363 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
346 | 364 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
347 | 365 | let accAmtAssetBalance = getAccBalance(amtAssetId) | |
348 | 366 | let accPriceAssetBalance = getAccBalance(priceAssetId) | |
349 | 367 | let curPriceX18 = if ((order.orderType == Buy)) | |
350 | 368 | then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance) | |
351 | 369 | else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance) | |
352 | 370 | let curPrice = fromX18(curPriceX18, scale8) | |
353 | 371 | if (if (if (isGlobalShutdown()) | |
354 | 372 | then true | |
355 | 373 | else (poolStatus == PoolMatcherDisabled)) | |
356 | 374 | then true | |
357 | 375 | else (poolStatus == PoolShutdown)) | |
358 | 376 | then throw("Exchange operations disabled") | |
359 | 377 | else { | |
360 | 378 | let orderAmtAsset = order.assetPair.amountAsset | |
361 | 379 | let orderAmtAssetStr = if ((orderAmtAsset == unit)) | |
362 | 380 | then "WAVES" | |
363 | 381 | else toBase58String(value(orderAmtAsset)) | |
364 | 382 | let orderPriceAsset = order.assetPair.priceAsset | |
365 | 383 | let orderPriceAssetStr = if ((orderPriceAsset == unit)) | |
366 | 384 | then "WAVES" | |
367 | 385 | else toBase58String(value(orderPriceAsset)) | |
368 | 386 | if (if ((orderAmtAssetStr != amtAssetId)) | |
369 | 387 | then true | |
370 | 388 | else (orderPriceAssetStr != priceAssetId)) | |
371 | 389 | then throw("Wrong order assets.") | |
372 | 390 | else { | |
373 | 391 | let orderPrice = order.price | |
374 | 392 | let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm) | |
375 | 393 | let castedOrderPrice = toScale(orderPrice, scale8, priceDcm) | |
376 | 394 | let isOrderPriceValid = if ((order.orderType == Buy)) | |
377 | 395 | then (curPrice >= castedOrderPrice) | |
378 | 396 | else (castedOrderPrice >= curPrice) | |
379 | 397 | true | |
380 | 398 | } | |
381 | 399 | } | |
382 | 400 | } | |
383 | 401 | ||
384 | 402 | ||
385 | 403 | func commonGet (i) = if ((size(i.payments) != 1)) | |
386 | 404 | then throw("exactly 1 payment is expected") | |
387 | 405 | else { | |
388 | 406 | let pmt = value(i.payments[0]) | |
389 | 407 | let pmtAssetId = value(pmt.assetId) | |
390 | 408 | let pmtAmt = pmt.amount | |
391 | 409 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
392 | 410 | let outAmAmt = res._1 | |
393 | 411 | let outPrAmt = res._2 | |
394 | 412 | let poolStatus = parseIntValue(res._9) | |
395 | 413 | let state = res._10 | |
396 | 414 | if (if (isGlobalShutdown()) | |
397 | 415 | then true | |
398 | 416 | else (poolStatus == PoolShutdown)) | |
399 | 417 | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
400 | 418 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
401 | 419 | } | |
402 | 420 | ||
403 | 421 | ||
404 | 422 | func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2)) | |
405 | 423 | then throw("exactly 2 payments are expected") | |
406 | 424 | else { | |
407 | 425 | let amAssetPmt = value(i.payments[0]) | |
408 | 426 | let prAssetPmt = value(i.payments[1]) | |
409 | 427 | let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp) | |
410 | 428 | let poolStatus = parseIntValue(estPut._8) | |
411 | 429 | if (if (if (isGlobalShutdown()) | |
412 | 430 | then true | |
413 | 431 | else (poolStatus == PoolPutDisabled)) | |
414 | 432 | then true | |
415 | 433 | else (poolStatus == PoolShutdown)) | |
416 | 434 | then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus))) | |
417 | 435 | else estPut | |
418 | 436 | } | |
419 | 437 | ||
420 | 438 | ||
421 | 439 | func emit (amount) = { | |
422 | 440 | let emitInv = invoke(factoryContract, "emit", [amount], nil) | |
423 | 441 | if ((emitInv == emitInv)) | |
424 | 442 | then { | |
425 | 443 | let emitInvLegacy = match emitInv { | |
426 | 444 | case legacyFactoryContract: Address => | |
427 | 445 | invoke(legacyFactoryContract, "emit", [amount], nil) | |
428 | 446 | case _ => | |
429 | 447 | unit | |
430 | 448 | } | |
431 | 449 | if ((emitInvLegacy == emitInvLegacy)) | |
432 | 450 | then amount | |
433 | 451 | else throw("Strict value is not equal to itself.") | |
434 | 452 | } | |
435 | 453 | else throw("Strict value is not equal to itself.") | |
436 | 454 | } | |
437 | 455 | ||
438 | 456 | ||
439 | 457 | func takeFee (amount) = { | |
440 | 458 | let feeAmount = fraction(amount, fee, scale8) | |
441 | 459 | $Tuple2((amount - feeAmount), feeAmount) | |
442 | 460 | } | |
443 | 461 | ||
444 | 462 | ||
445 | 463 | func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = { | |
446 | 464 | let isEval = (txId == unit) | |
447 | - | let $ | |
448 | - | let poolAddress = $ | |
449 | - | let poolStatus = $ | |
450 | - | let lpAssetId = $ | |
451 | - | let amountAssetId = $ | |
452 | - | let priceAssetId = $ | |
453 | - | let amountAssetDecimals = $ | |
454 | - | let priceAssetDecimals = $ | |
465 | + | let $t02216722345 = parsePoolConfig(getPoolConfig()) | |
466 | + | let poolAddress = $t02216722345._1 | |
467 | + | let poolStatus = $t02216722345._2 | |
468 | + | let lpAssetId = $t02216722345._3 | |
469 | + | let amountAssetId = $t02216722345._4 | |
470 | + | let priceAssetId = $t02216722345._5 | |
471 | + | let amountAssetDecimals = $t02216722345._6 | |
472 | + | let priceAssetDecimals = $t02216722345._7 | |
455 | 473 | let amountBalanceRaw = getAccBalance(assetIdToString(amountAssetId)) | |
456 | 474 | let priceBalanceRaw = getAccBalance(assetIdToString(priceAssetId)) | |
457 | 475 | let paymentInAmountAsset = if ((paymentAssetId == amountAssetId)) | |
458 | 476 | then true | |
459 | 477 | else if ((paymentAssetId == priceAssetId)) | |
460 | 478 | then false | |
461 | 479 | else throwErr("invalid asset") | |
462 | - | let $ | |
480 | + | let $t02267522968 = if (isEval) | |
463 | 481 | then $Tuple2(amountBalanceRaw, priceBalanceRaw) | |
464 | 482 | else if (paymentInAmountAsset) | |
465 | 483 | then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw) | |
466 | 484 | else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw)) | |
467 | - | let amountBalanceOld = $ | |
468 | - | let priceBalanceOld = $ | |
469 | - | let $ | |
485 | + | let amountBalanceOld = $t02267522968._1 | |
486 | + | let priceBalanceOld = $t02267522968._2 | |
487 | + | let $t02297223121 = if (paymentInAmountAsset) | |
470 | 488 | then $Tuple2(paymentAmountRaw, 0) | |
471 | 489 | else $Tuple2(0, paymentAmountRaw) | |
472 | - | let amountAssetAmountRaw = $ | |
473 | - | let priceAssetAmountRaw = $ | |
490 | + | let amountAssetAmountRaw = $t02297223121._1 | |
491 | + | let priceAssetAmountRaw = $t02297223121._2 | |
474 | 492 | let amountAssetAmount = takeFee(amountAssetAmountRaw)._1 | |
475 | 493 | let priceAssetAmount = takeFee(priceAssetAmountRaw)._1 | |
476 | - | let $ | |
477 | - | let paymentAmount = $ | |
478 | - | let feeAmount = $ | |
494 | + | let $t02324323302 = takeFee(paymentAmountRaw) | |
495 | + | let paymentAmount = $t02324323302._1 | |
496 | + | let feeAmount = $t02324323302._2 | |
479 | 497 | let amountBalanceNew = (amountBalanceOld + amountAssetAmount) | |
480 | 498 | let priceBalanceNew = (priceBalanceOld + priceAssetAmount) | |
481 | 499 | let curPrice = fromX18(calcPriceBigInt(toX18(priceBalanceNew, priceAssetDecimals), toX18(amountBalanceNew, amountAssetDecimals)), scale8) | |
482 | 500 | let paymentBalance = if (paymentInAmountAsset) | |
483 | 501 | then amountBalanceOld | |
484 | 502 | else priceBalanceOld | |
485 | 503 | let paymentBalanceBigInt = toBigInt(paymentBalance) | |
486 | 504 | let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity) | |
487 | 505 | let chechSupply = if ((supplyBigInt > big0)) | |
488 | 506 | then true | |
489 | 507 | else throw("initial deposit requires all coins") | |
490 | 508 | if ((chechSupply == chechSupply)) | |
491 | 509 | then { | |
492 | 510 | let depositBigInt = toBigInt(paymentAmount) | |
493 | 511 | let issueAmount = toInt(((supplyBigInt * (sqrtBigInt((scale8BigInt + ((depositBigInt * scale8BigInt) / paymentBalanceBigInt)), 8, 8, DOWN) - scale8BigInt)) / scale8BigInt)) | |
494 | 512 | let commonState = if (isEval) | |
495 | 513 | then nil | |
496 | 514 | else [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(toString(value(userAddress)), toBase58String(value(txId))), dataPutActionInfo(amountAssetAmountRaw, priceAssetAmountRaw, issueAmount, curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
497 | 515 | let poolProportion = fraction(priceBalanceOld, scale8, amountBalanceOld) | |
498 | 516 | let amountAssetPart = fraction(paymentAmountRaw, scale8, (poolProportion + scale8)) | |
499 | 517 | let priceAssetPart = (paymentAmountRaw - amountAssetPart) | |
500 | 518 | let lpAmtBoth = fraction(supplyBigInt, toBigInt(priceAssetPart), toBigInt(priceBalanceOld)) | |
501 | 519 | let bonus = toInt(fraction((toBigInt(issueAmount) - lpAmtBoth), scale8BigInt, lpAmtBoth)) | |
502 | 520 | $Tuple4(issueAmount, commonState, feeAmount, bonus) | |
503 | 521 | } | |
504 | 522 | else throw("Strict value is not equal to itself.") | |
505 | 523 | } | |
506 | 524 | ||
507 | 525 | ||
508 | 526 | func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = { | |
509 | 527 | let isEval = (txId == unit) | |
510 | - | let $ | |
511 | - | let poolAddress = $ | |
512 | - | let poolStatus = $ | |
513 | - | let lpAssetId = $ | |
514 | - | let amountAssetId = $ | |
515 | - | let priceAssetId = $ | |
516 | - | let amDecimals = $ | |
517 | - | let prDecimals = $ | |
528 | + | let $t02525225413 = parsePoolConfig(getPoolConfig()) | |
529 | + | let poolAddress = $t02525225413._1 | |
530 | + | let poolStatus = $t02525225413._2 | |
531 | + | let lpAssetId = $t02525225413._3 | |
532 | + | let amountAssetId = $t02525225413._4 | |
533 | + | let priceAssetId = $t02525225413._5 | |
534 | + | let amDecimals = $t02525225413._6 | |
535 | + | let prDecimals = $t02525225413._7 | |
518 | 536 | let checks = [if ((paymentAssetId == lpAssetId)) | |
519 | 537 | then true | |
520 | 538 | else throw("invalid lp asset")] | |
521 | 539 | if ((checks == checks)) | |
522 | 540 | then { | |
523 | 541 | let outInAmountAsset = if ((outAssetId == amountAssetId)) | |
524 | 542 | then true | |
525 | 543 | else if ((outAssetId == priceAssetId)) | |
526 | 544 | then false | |
527 | 545 | else throwErr("invalid asset") | |
528 | 546 | let balanceBigInt = if (outInAmountAsset) | |
529 | 547 | then toBigInt(getAccBalance(assetIdToString(amountAssetId))) | |
530 | 548 | else toBigInt(getAccBalance(assetIdToString(priceAssetId))) | |
531 | 549 | let amBalanceOld = getAccBalance(assetIdToString(amountAssetId)) | |
532 | 550 | let prBalanceOld = getAccBalance(assetIdToString(priceAssetId)) | |
533 | 551 | let outBalance = if (outInAmountAsset) | |
534 | 552 | then amBalanceOld | |
535 | 553 | else prBalanceOld | |
536 | 554 | let outBalanceBigInt = toBigInt(outBalance) | |
537 | 555 | let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity) | |
538 | 556 | let redeemedBigInt = toBigInt(paymentAmount) | |
539 | 557 | let amountRaw = toInt(((balanceBigInt * (scale8BigInt - pow((scale8BigInt - ((redeemedBigInt * scale8BigInt) / supplyBigInt)), 8, big2, 0, 8, DOWN))) / scale8BigInt)) | |
540 | - | let $ | |
541 | - | let totalAmount = $ | |
542 | - | let feeAmount = $ | |
543 | - | let $ | |
558 | + | let $t02648026530 = takeFee(amountRaw) | |
559 | + | let totalAmount = $t02648026530._1 | |
560 | + | let feeAmount = $t02648026530._2 | |
561 | + | let $t02653426760 = if (outInAmountAsset) | |
544 | 562 | then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld) | |
545 | 563 | else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw)) | |
546 | - | let outAmAmount = $ | |
547 | - | let outPrAmount = $ | |
548 | - | let amBalanceNew = $ | |
549 | - | let prBalanceNew = $ | |
564 | + | let outAmAmount = $t02653426760._1 | |
565 | + | let outPrAmount = $t02653426760._2 | |
566 | + | let amBalanceNew = $t02653426760._3 | |
567 | + | let prBalanceNew = $t02653426760._4 | |
550 | 568 | let curPrX18 = calcPriceBigInt(toX18(prBalanceNew, prDecimals), toX18(amBalanceNew, amDecimals)) | |
551 | 569 | let curPrice = fromX18(curPrX18, scale8) | |
552 | 570 | let commonState = if (isEval) | |
553 | 571 | then nil | |
554 | 572 | else [StringEntry(gau(toString(value(userAddress)), toBase58String(value(txId))), dataGetActionInfo(outAmAmount, outPrAmount, paymentAmount, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)] | |
555 | 573 | let r = estimateGetOperation("", assetIdToString(lpAssetId), paymentAmount, this) | |
556 | 574 | let sumOfGetAssets = (r._1 + r._2) | |
557 | 575 | let bonus = fraction((totalAmount - sumOfGetAssets), scale8, sumOfGetAssets) | |
558 | 576 | $Tuple4(totalAmount, commonState, feeAmount, bonus) | |
559 | 577 | } | |
560 | 578 | else throw("Strict value is not equal to itself.") | |
561 | 579 | } | |
562 | 580 | ||
563 | 581 | ||
564 | 582 | func managerPublicKeyOrUnit () = match getString(mpk()) { | |
565 | 583 | case s: String => | |
566 | 584 | fromBase58String(s) | |
567 | 585 | case _: Unit => | |
568 | 586 | unit | |
569 | 587 | case _ => | |
570 | 588 | throw("Match error") | |
571 | 589 | } | |
572 | 590 | ||
573 | 591 | ||
574 | 592 | func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) { | |
575 | 593 | case s: String => | |
576 | 594 | fromBase58String(s) | |
577 | 595 | case _: Unit => | |
578 | 596 | unit | |
579 | 597 | case _ => | |
580 | 598 | throw("Match error") | |
581 | 599 | } | |
582 | 600 | ||
583 | 601 | ||
584 | 602 | func mustManager (i) = { | |
585 | 603 | let pd = throw("Permission denied") | |
586 | 604 | match managerPublicKeyOrUnit() { | |
587 | 605 | case pk: ByteVector => | |
588 | 606 | if ((i.callerPublicKey == pk)) | |
589 | 607 | then true | |
590 | 608 | else pd | |
591 | 609 | case _: Unit => | |
592 | 610 | if ((i.caller == this)) | |
593 | 611 | then true | |
594 | 612 | else pd | |
595 | 613 | case _ => | |
596 | 614 | throw("Match error") | |
597 | 615 | } | |
598 | 616 | } | |
599 | 617 | ||
600 | 618 | ||
601 | 619 | @Callable(i) | |
602 | 620 | func setManager (pendingManagerPublicKey) = { | |
603 | 621 | let checkCaller = mustManager(i) | |
604 | 622 | if ((checkCaller == checkCaller)) | |
605 | 623 | then { | |
606 | 624 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
607 | 625 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
608 | 626 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
609 | 627 | else throw("Strict value is not equal to itself.") | |
610 | 628 | } | |
611 | 629 | else throw("Strict value is not equal to itself.") | |
612 | 630 | } | |
613 | 631 | ||
614 | 632 | ||
615 | 633 | ||
616 | 634 | @Callable(i) | |
617 | 635 | func confirmManager () = { | |
618 | 636 | let pm = pendingManagerPublicKeyOrUnit() | |
619 | 637 | let hasPM = if (isDefined(pm)) | |
620 | 638 | then true | |
621 | 639 | else throw("No pending manager") | |
622 | 640 | if ((hasPM == hasPM)) | |
623 | 641 | then { | |
624 | 642 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
625 | 643 | then true | |
626 | 644 | else throw("You are not pending manager") | |
627 | 645 | if ((checkPM == checkPM)) | |
628 | 646 | then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())] | |
629 | 647 | else throw("Strict value is not equal to itself.") | |
630 | 648 | } | |
631 | 649 | else throw("Strict value is not equal to itself.") | |
632 | 650 | } | |
633 | 651 | ||
634 | 652 | ||
635 | 653 | ||
636 | 654 | @Callable(i) | |
637 | 655 | func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance)) | |
638 | 656 | then throw("Invalid slippageTolerance passed") | |
639 | 657 | else { | |
640 | 658 | let estPut = commonPut(i, slippageTolerance, true) | |
641 | 659 | let emitLpAmt = estPut._2 | |
642 | 660 | let lpAssetId = estPut._7 | |
643 | 661 | let state = estPut._9 | |
644 | 662 | let amDiff = estPut._10 | |
645 | 663 | let prDiff = estPut._11 | |
646 | 664 | let amId = estPut._12 | |
647 | 665 | let prId = estPut._13 | |
648 | 666 | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
649 | 667 | if ((emitInv == emitInv)) | |
650 | 668 | then { | |
651 | 669 | let emitInvLegacy = match emitInv { | |
652 | 670 | case legacyFactoryContract: Address => | |
653 | 671 | invoke(legacyFactoryContract, "emit", [emitLpAmt], nil) | |
654 | 672 | case _ => | |
655 | 673 | unit | |
656 | 674 | } | |
657 | 675 | if ((emitInvLegacy == emitInvLegacy)) | |
658 | 676 | then { | |
659 | 677 | let slippageAInv = if ((amDiff > 0)) | |
660 | 678 | then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)]) | |
661 | 679 | else nil | |
662 | 680 | if ((slippageAInv == slippageAInv)) | |
663 | 681 | then { | |
664 | 682 | let slippagePInv = if ((prDiff > 0)) | |
665 | 683 | then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)]) | |
666 | 684 | else nil | |
667 | 685 | if ((slippagePInv == slippagePInv)) | |
668 | 686 | then { | |
669 | 687 | let lpTransfer = if (shouldAutoStake) | |
670 | 688 | then { | |
671 | 689 | let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
672 | 690 | if ((slpStakeInv == slpStakeInv)) | |
673 | 691 | then nil | |
674 | 692 | else throw("Strict value is not equal to itself.") | |
675 | 693 | } | |
676 | 694 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
677 | 695 | (state ++ lpTransfer) | |
678 | 696 | } | |
679 | 697 | else throw("Strict value is not equal to itself.") | |
680 | 698 | } | |
681 | 699 | else throw("Strict value is not equal to itself.") | |
682 | 700 | } | |
683 | 701 | else throw("Strict value is not equal to itself.") | |
684 | 702 | } | |
685 | 703 | else throw("Strict value is not equal to itself.") | |
686 | 704 | } | |
687 | 705 | ||
688 | 706 | ||
689 | 707 | ||
690 | 708 | @Callable(i) | |
691 | 709 | func putForFree (maxSlippage) = if ((0 > maxSlippage)) | |
692 | 710 | then throw("Invalid value passed") | |
693 | 711 | else { | |
694 | 712 | let estPut = commonPut(i, maxSlippage, false) | |
695 | 713 | estPut._9 | |
696 | 714 | } | |
697 | 715 | ||
698 | 716 | ||
699 | 717 | ||
700 | 718 | @Callable(i) | |
701 | 719 | func putOneTkn (minOutAmount,autoStake) = { | |
702 | - | let $t03042630604 = parsePoolConfig(getPoolConfig()) | |
703 | - | let poolAddress = $t03042630604._1 | |
704 | - | let poolStatus = $t03042630604._2 | |
705 | - | let lpAssetId = $t03042630604._3 | |
706 | - | let amountAssetId = $t03042630604._4 | |
707 | - | let priceAssetId = $t03042630604._5 | |
708 | - | let amountAssetDecimals = $t03042630604._6 | |
709 | - | let priceAssetDecimals = $t03042630604._7 | |
710 | 720 | let isPutDisabled = if (if (isGlobalShutdown()) | |
711 | 721 | then true | |
712 | - | else ( | |
722 | + | else (cfgPoolStatus == PoolPutDisabled)) | |
713 | 723 | then true | |
714 | - | else ( | |
724 | + | else (cfgPoolStatus == PoolShutdown) | |
715 | 725 | let checks = [if (!(isPutDisabled)) | |
716 | 726 | then true | |
717 | 727 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
718 | 728 | then true | |
719 | 729 | else throwErr("exactly 1 payment are expected")] | |
720 | 730 | if ((checks == checks)) | |
721 | 731 | then { | |
722 | 732 | let payment = i.payments[0] | |
723 | 733 | let paymentAssetId = payment.assetId | |
724 | 734 | let paymentAmountRaw = payment.amount | |
725 | - | let paymentAmount = paymentAmountRaw | |
726 | 735 | let userAddress = i.caller | |
727 | 736 | let txId = i.transactionId | |
728 | - | let $ | |
729 | - | let emitAmountEstimated = $ | |
730 | - | let commonState = $ | |
731 | - | let feeAmount = $ | |
732 | - | let bonus = $ | |
737 | + | let $t03110131228 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId) | |
738 | + | let emitAmountEstimated = $t03110131228._1 | |
739 | + | let commonState = $t03110131228._2 | |
740 | + | let feeAmount = $t03110131228._3 | |
741 | + | let bonus = $t03110131228._4 | |
733 | 742 | let emitAmount = if (if ((minOutAmount > 0)) | |
734 | 743 | then (minOutAmount > emitAmountEstimated) | |
735 | 744 | else false) | |
736 | 745 | then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
737 | 746 | else emitAmountEstimated | |
738 | 747 | let emitInv = emit(emitAmount) | |
739 | 748 | if ((emitInv == emitInv)) | |
740 | 749 | then { | |
741 | 750 | let lpTransfer = if (autoStake) | |
742 | 751 | then { | |
743 | - | let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment( | |
752 | + | let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)]) | |
744 | 753 | if ((stakeInv == stakeInv)) | |
745 | 754 | then nil | |
746 | 755 | else throw("Strict value is not equal to itself.") | |
747 | 756 | } | |
748 | - | else [ScriptTransfer(i.caller, emitAmount, | |
757 | + | else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)] | |
749 | 758 | let sendFee = if ((feeAmount > 0)) | |
750 | 759 | then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)] | |
751 | 760 | else nil | |
752 | 761 | $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount) | |
753 | 762 | } | |
754 | 763 | else throw("Strict value is not equal to itself.") | |
755 | 764 | } | |
756 | 765 | else throw("Strict value is not equal to itself.") | |
757 | 766 | } | |
758 | 767 | ||
759 | 768 | ||
760 | 769 | ||
761 | 770 | @Callable(i) | |
771 | + | func putOneTknREADONLY (paymentAmountRaw,paymentAssetId) = { | |
772 | + | let $t03195432089 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit) | |
773 | + | let emitAmountEstimated = $t03195432089._1 | |
774 | + | let commonState = $t03195432089._2 | |
775 | + | let feeAmount = $t03195432089._3 | |
776 | + | let bonus = $t03195432089._4 | |
777 | + | $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus)) | |
778 | + | } | |
779 | + | ||
780 | + | ||
781 | + | ||
782 | + | @Callable(i) | |
762 | 783 | func getOneTkn (outAssetId,minOutAmount,unstakeAmount) = { | |
763 | - | let $t03194232120 = parsePoolConfig(getPoolConfig()) | |
764 | - | let poolAddress = $t03194232120._1 | |
765 | - | let poolStatus = $t03194232120._2 | |
766 | - | let lpAssetId = $t03194232120._3 | |
767 | - | let amountAssetId = $t03194232120._4 | |
768 | - | let priceAssetId = $t03194232120._5 | |
769 | - | let amountAssetDecimals = $t03194232120._6 | |
770 | - | let priceAssetDecimals = $t03194232120._7 | |
771 | 784 | let isGetDisabled = if (isGlobalShutdown()) | |
772 | 785 | then true | |
773 | - | else ( | |
786 | + | else (cfgPoolStatus == PoolShutdown) | |
774 | 787 | let checks = [if (!(isGetDisabled)) | |
775 | 788 | then true | |
776 | 789 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
777 | 790 | then true | |
778 | 791 | else throwErr("exactly 1 payment are expected")] | |
779 | 792 | if ((checks == checks)) | |
780 | 793 | then { | |
781 | 794 | let payment = i.payments[0] | |
782 | 795 | let paymentAssetId = payment.assetId | |
783 | 796 | let paymentAmount = payment.amount | |
784 | 797 | let userAddress = i.caller | |
785 | 798 | let txId = i.transactionId | |
786 | - | let $ | |
787 | - | let amountEstimated = $ | |
788 | - | let commonState = $ | |
789 | - | let feeAmount = $ | |
790 | - | let bonus = $ | |
799 | + | let $t03264532792 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, paymentAssetId, userAddress, txId) | |
800 | + | let amountEstimated = $t03264532792._1 | |
801 | + | let commonState = $t03264532792._2 | |
802 | + | let feeAmount = $t03264532792._3 | |
803 | + | let bonus = $t03264532792._4 | |
791 | 804 | let amount = if (if ((minOutAmount > 0)) | |
792 | 805 | then (minOutAmount > amountEstimated) | |
793 | 806 | else false) | |
794 | 807 | then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
795 | 808 | else amountEstimated | |
796 | 809 | let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)]) | |
797 | 810 | if ((burnInv == burnInv)) | |
798 | 811 | then { | |
799 | 812 | let assetTransfer = [ScriptTransfer(userAddress, amount, parseAssetId(outAssetId))] | |
800 | 813 | $Tuple2(assetTransfer, amount) | |
801 | 814 | } | |
802 | 815 | else throw("Strict value is not equal to itself.") | |
803 | 816 | } | |
804 | 817 | else throw("Strict value is not equal to itself.") | |
818 | + | } | |
819 | + | ||
820 | + | ||
821 | + | ||
822 | + | @Callable(i) | |
823 | + | func getOneTknREADONLY (outAssetId,paymentAmount) = { | |
824 | + | let $t03330333441 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit) | |
825 | + | let amountEstimated = $t03330333441._1 | |
826 | + | let commonState = $t03330333441._2 | |
827 | + | let feeAmount = $t03330333441._3 | |
828 | + | let bonus = $t03330333441._4 | |
829 | + | $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus)) | |
805 | 830 | } | |
806 | 831 | ||
807 | 832 | ||
808 | 833 | ||
809 | 834 | @Callable(i) | |
810 | 835 | func get () = { | |
811 | 836 | let res = commonGet(i) | |
812 | 837 | let outAmtAmt = res._1 | |
813 | 838 | let outPrAmt = res._2 | |
814 | 839 | let pmtAmt = res._3 | |
815 | 840 | let pmtAssetId = res._4 | |
816 | 841 | let state = res._5 | |
817 | 842 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
818 | 843 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
819 | 844 | then state | |
820 | 845 | else throw("Strict value is not equal to itself.") | |
821 | 846 | } | |
822 | 847 | ||
823 | 848 | ||
824 | 849 | ||
825 | 850 | @Callable(i) | |
826 | 851 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
827 | 852 | let res = commonGet(i) | |
828 | 853 | let outAmAmt = res._1 | |
829 | 854 | let outPrAmt = res._2 | |
830 | 855 | let pmtAmt = res._3 | |
831 | 856 | let pmtAssetId = res._4 | |
832 | 857 | let state = res._5 | |
833 | 858 | if ((noLessThenAmtAsset > outAmAmt)) | |
834 | 859 | then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
835 | 860 | else if ((noLessThenPriceAsset > outPrAmt)) | |
836 | 861 | then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
837 | 862 | else { | |
838 | 863 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
839 | 864 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
840 | 865 | then state | |
841 | 866 | else throw("Strict value is not equal to itself.") | |
842 | 867 | } | |
843 | 868 | } | |
844 | 869 | ||
845 | 870 | ||
846 | 871 | ||
847 | 872 | @Callable(i) | |
848 | 873 | func unstakeAndGet (amount) = { | |
849 | 874 | let checkPayments = if ((size(i.payments) != 0)) | |
850 | 875 | then throw("No payments are expected") | |
851 | 876 | else true | |
852 | 877 | if ((checkPayments == checkPayments)) | |
853 | 878 | then { | |
854 | 879 | let cfg = getPoolConfig() | |
855 | 880 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
856 | 881 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil) | |
857 | 882 | if ((unstakeInv == unstakeInv)) | |
858 | 883 | then { | |
859 | 884 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
860 | 885 | let poolStatus = parseIntValue(res._9) | |
861 | 886 | let state = res._10 | |
862 | 887 | let checkPoolStatus = if (if (isGlobalShutdown()) | |
863 | 888 | then true | |
864 | 889 | else (poolStatus == PoolShutdown)) | |
865 | 890 | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
866 | 891 | else true | |
867 | 892 | if ((checkPoolStatus == checkPoolStatus)) | |
868 | 893 | then { | |
869 | 894 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
870 | 895 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
871 | 896 | then state | |
872 | 897 | else throw("Strict value is not equal to itself.") | |
873 | 898 | } | |
874 | 899 | else throw("Strict value is not equal to itself.") | |
875 | 900 | } | |
876 | 901 | else throw("Strict value is not equal to itself.") | |
877 | 902 | } | |
878 | 903 | else throw("Strict value is not equal to itself.") | |
879 | 904 | } | |
880 | 905 | ||
881 | 906 | ||
882 | 907 | ||
883 | 908 | @Callable(i) | |
884 | 909 | func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract))) | |
885 | 910 | then throw("permissions denied") | |
886 | 911 | else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success") | |
887 | 912 | ||
888 | 913 | ||
889 | 914 | ||
890 | 915 | @Callable(i) | |
891 | 916 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig()) | |
892 | 917 | ||
893 | 918 | ||
894 | 919 | ||
895 | 920 | @Callable(i) | |
896 | 921 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
897 | 922 | ||
898 | 923 | ||
899 | 924 | ||
900 | 925 | @Callable(i) | |
901 | 926 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
902 | 927 | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
903 | 928 | $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])]) | |
904 | 929 | } | |
905 | 930 | ||
906 | 931 | ||
907 | 932 | ||
908 | 933 | @Callable(i) | |
909 | 934 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult))) | |
910 | 935 | ||
911 | 936 | ||
912 | 937 | ||
913 | 938 | @Callable(i) | |
914 | 939 | func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult)) | |
915 | 940 | ||
916 | 941 | ||
917 | 942 | ||
918 | 943 | @Callable(i) | |
919 | 944 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
920 | 945 | ||
921 | 946 | ||
922 | 947 | ||
923 | 948 | @Callable(i) | |
924 | 949 | func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp)) | |
925 | 950 | ||
926 | 951 | ||
927 | 952 | ||
928 | 953 | @Callable(i) | |
929 | 954 | func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
930 | 955 | let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress)) | |
931 | 956 | $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10)) | |
932 | 957 | } | |
933 | 958 | ||
934 | 959 | ||
935 | 960 | ||
936 | 961 | @Callable(i) | |
937 | 962 | func statsREADONLY () = { | |
938 | 963 | let cfg = getPoolConfig() | |
939 | 964 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
940 | 965 | let amtAssetId = cfg[idxAmtAssetId] | |
941 | 966 | let priceAssetId = cfg[idxPriceAssetId] | |
942 | 967 | let iAmtAssetId = cfg[idxIAmtAssetId] | |
943 | 968 | let iPriceAssetId = cfg[idxIPriceAssetId] | |
944 | 969 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
945 | 970 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
946 | 971 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
947 | 972 | let accAmtAssetBalance = getAccBalance(amtAssetId) | |
948 | 973 | let accPriceAssetBalance = getAccBalance(priceAssetId) | |
949 | 974 | let pricesList = if ((poolLPBalance == 0)) | |
950 | 975 | then [zeroBigInt, zeroBigInt, zeroBigInt] | |
951 | 976 | else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance) | |
952 | 977 | let curPrice = 0 | |
953 | 978 | let lpAmtAssetShare = fromX18(pricesList[1], scale8) | |
954 | 979 | let lpPriceAssetShare = fromX18(pricesList[2], scale8) | |
955 | 980 | let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this)))) | |
956 | 981 | $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)) | |
957 | 982 | } | |
958 | 983 | ||
959 | 984 | ||
960 | 985 | ||
961 | 986 | @Callable(i) | |
962 | 987 | func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = { | |
963 | 988 | let cfg = getPoolConfig() | |
964 | 989 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
965 | 990 | let amAssetIdStr = cfg[idxAmtAssetId] | |
966 | 991 | let amAssetId = fromBase58String(amAssetIdStr) | |
967 | 992 | let prAssetIdStr = cfg[idxPriceAssetId] | |
968 | 993 | let prAssetId = fromBase58String(prAssetIdStr) | |
969 | 994 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
970 | 995 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
971 | 996 | let poolStatus = cfg[idxPoolStatus] | |
972 | 997 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
973 | 998 | let accAmtAssetBalance = getAccBalance(amAssetIdStr) | |
974 | 999 | let accPriceAssetBalance = getAccBalance(prAssetIdStr) | |
975 | 1000 | let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm) | |
976 | 1001 | let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm) | |
977 | 1002 | let curPriceX18 = if ((poolLPBalance == 0)) | |
978 | 1003 | then zeroBigInt | |
979 | 1004 | else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
980 | 1005 | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
981 | 1006 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
982 | 1007 | let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm) | |
983 | 1008 | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
984 | 1009 | let calcLpAmt = estPut._1 | |
985 | 1010 | let curPriceCalc = estPut._3 | |
986 | 1011 | let amBalance = estPut._4 | |
987 | 1012 | let prBalance = estPut._5 | |
988 | 1013 | let lpEmission = estPut._6 | |
989 | 1014 | $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)) | |
990 | 1015 | } | |
991 | 1016 | ||
992 | 1017 | ||
993 | 1018 | ||
994 | 1019 | @Callable(i) | |
995 | 1020 | func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = { | |
996 | 1021 | let cfg = getPoolConfig() | |
997 | 1022 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
998 | 1023 | let amAssetIdStr = cfg[idxAmtAssetId] | |
999 | 1024 | let amAssetId = fromBase58String(amAssetIdStr) | |
1000 | 1025 | let prAssetIdStr = cfg[idxPriceAssetId] | |
1001 | 1026 | let prAssetId = fromBase58String(prAssetIdStr) | |
1002 | 1027 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
1003 | 1028 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
1004 | 1029 | let poolStatus = cfg[idxPoolStatus] | |
1005 | 1030 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
1006 | 1031 | let amBalanceRaw = getAccBalance(amAssetIdStr) | |
1007 | 1032 | let prBalanceRaw = getAccBalance(prAssetIdStr) | |
1008 | 1033 | let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm) | |
1009 | 1034 | let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm) | |
1010 | 1035 | let curPriceX18 = if ((poolLPBalance == 0)) | |
1011 | 1036 | then zeroBigInt | |
1012 | 1037 | else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18) | |
1013 | 1038 | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
1014 | 1039 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
1015 | 1040 | let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm) | |
1016 | 1041 | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
1017 | 1042 | let calcLpAmt = estPut._1 | |
1018 | 1043 | let curPriceCalc = estPut._3 | |
1019 | 1044 | let amBalance = estPut._4 | |
1020 | 1045 | let prBalance = estPut._5 | |
1021 | 1046 | let lpEmission = estPut._6 | |
1022 | 1047 | $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)) | |
1023 | 1048 | } | |
1024 | 1049 | ||
1025 | 1050 | ||
1026 | 1051 | ||
1027 | 1052 | @Callable(i) | |
1028 | 1053 | func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
1029 | 1054 | let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this) | |
1030 | 1055 | let outAmAmt = res._1 | |
1031 | 1056 | let outPrAmt = res._2 | |
1032 | 1057 | let amBalance = res._5 | |
1033 | 1058 | let prBalance = res._6 | |
1034 | 1059 | let lpEmission = res._7 | |
1035 | 1060 | let curPrice = res._8 | |
1036 | 1061 | let poolStatus = parseIntValue(res._9) | |
1037 | 1062 | $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)) | |
1038 | 1063 | } | |
1039 | 1064 | ||
1040 | 1065 | ||
1041 | 1066 | @Verifier(tx) | |
1042 | 1067 | func verify () = { | |
1043 | 1068 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
1044 | 1069 | case pk: ByteVector => | |
1045 | 1070 | pk | |
1046 | 1071 | case _: Unit => | |
1047 | 1072 | tx.senderPublicKey | |
1048 | 1073 | case _ => | |
1049 | 1074 | throw("Match error") | |
1050 | 1075 | } | |
1051 | 1076 | match tx { | |
1052 | 1077 | case order: Order => | |
1053 | 1078 | let matcherPub = getMatcherPubOrFail() | |
1054 | 1079 | let orderValid = validateMatcherOrderAllowed(order) | |
1055 | 1080 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1056 | 1081 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1057 | 1082 | if (if (if (orderValid) | |
1058 | 1083 | then senderValid | |
1059 | 1084 | else false) | |
1060 | 1085 | then matcherValid | |
1061 | 1086 | else false) | |
1062 | 1087 | then true | |
1063 | 1088 | else throwOrderError(orderValid, senderValid, matcherValid) | |
1064 | 1089 | case s: SetScriptTransaction => | |
1065 | 1090 | let newHash = blake2b256(value(s.script)) | |
1066 | 1091 | let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash()))) | |
1067 | 1092 | let currentHash = scriptHash(this) | |
1068 | 1093 | if (if ((allowedHash == newHash)) | |
1069 | 1094 | then (currentHash != newHash) | |
1070 | 1095 | else false) | |
1071 | 1096 | then true | |
1072 | 1097 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1073 | 1098 | case _ => | |
1074 | 1099 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1075 | 1100 | } | |
1076 | 1101 | } | |
1077 | 1102 |
github/deemru/w8io/169f3d6 117.70 ms ◑