tx · BRGUuwmKsMY4YGncvLohaKebGnALhZaoJ1XW3Txh81pB 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.28000000 Waves 2023.04.18 12:27 [2539810] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "BRGUuwmKsMY4YGncvLohaKebGnALhZaoJ1XW3Txh81pB", "fee": 28000000, "feeAssetId": null, "timestamp": 1681810071871, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "C9MPpLBHnGpor52LnjGBYvUnKMa93eXZ3WXvi9FeUEXsnrRnEqbtQZsnNvqrJDH9jwczNm42fR6rdXiJbfTWP9y" ], "script": "base64:BgJVCAISBQoDCAEIEgUKAwgBCBIDCgEIEgQKAggBEgMKAQgSDgoMCAgIAQQRGBgRAQEYEgoKCAgICAEECAEYEg4KDAgICAEEGBgYGBgBGBIHCgUICAEBAUIAB1NGX1BPT0wCAlNGAAdXWF9QT09MAgJXWAAHQ0FQX0ZFRQIDY2FwAAhMT0FOX0ZFRQIEbG9hbgALTk9fTE9BTl9GRUUCBm5vTG9hbgAGU0NBTEU4AIDC1y8AB1NDQUxFMTAAgMivoCUACkZFRV9TQ0FMRTYAwIQ9ABRrU0ZQb29sQUFzc2V0QmFsYW5jZQIPQV9hc3NldF9iYWxhbmNlABRrU0ZQb29sQkFzc2V0QmFsYW5jZQIPQl9hc3NldF9iYWxhbmNlAA9rU0ZQb29sQUFzc2V0SWQCCkFfYXNzZXRfaWQAD2tTRlBvb2xCQXNzZXRJZAIKQl9hc3NldF9pZAAOa1NGUG9vbFNoYXJlSWQCDnNoYXJlX2Fzc2V0X2lkAAprU0ZQb29sRmVlAgpjb21taXNzaW9uAA1rVXNlclBvc2l0aW9uAg5fdXNlcl9wb3NpdGlvbgARa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bnRyeQFpAQtpbml0TmV3UG9vbAUEdHlwZQhwb29sQWRkcgtpbkZlZU5vTG9hbglpbkZlZUxvYW4GY2FwRmVlAwMJAQIhPQIFBHR5cGUFB1NGX1BPT0wJAQIhPQIFBHR5cGUFB1dYX1BPT0wHCQACAQIKV3JvbmcgdHlwZQkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQhwb29sQWRkcgUVa0F4bHlJbkZlZVdpdGhvdXRMb2FuBQtpbkZlZU5vTG9hbgkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQhwb29sQWRkcgUSa0F4bHlJbkZlZVdpdGhMb2FuBQlpbkZlZUxvYW4JAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFC2tBeGx5Q2FwRmVlBQZjYXBGZWUJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFDWtQb29sSW50ZXJlc3QAAAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFBWtQb29sBQhwb29sQWRkcgUEdHlwZQUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleYeF+eA=", "height": 2539810, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5icAixP2HAxx5V1Tf9LnFxQXzcPkWYG2bP9q6nB6GPG2 Next: A3vqRNg758z1HUkb5iZ1PU9ZWmSeYNW46nMCQkeWoHHr Diff:
Old | New | Differences | |
---|---|---|---|
456 | 456 | } | |
457 | 457 | let amountToPay = $t01440814696._1 | |
458 | 458 | let assetToPay = $t01440814696._2 | |
459 | - | invoke(poolAddr, "callFunction", ["exchange", "1"], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
459 | + | invoke(poolAddr, "callFunction", ["exchange", ["1"]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
460 | 460 | } | |
461 | 461 | ||
462 | 462 | ||
465 | 465 | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
466 | 466 | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
467 | 467 | let feeScale = toBigInt(100000000) | |
468 | - | let $ | |
468 | + | let $t01517515483 = if ((assetTokenToGet == assetIdA)) | |
469 | 469 | then { | |
470 | 470 | let amountToPay = fraction(balA, amountTokenToGet, (balB - amountTokenToGet)) | |
471 | 471 | $Tuple2(amountToPay, assetIdB) | |
474 | 474 | let amountToPay = fraction(balB, amountTokenToGet, (balA - amountTokenToGet)) | |
475 | 475 | $Tuple2(amountToPay, assetIdA) | |
476 | 476 | } | |
477 | - | let amountToPay = $ | |
478 | - | let assetToPay = $ | |
477 | + | let amountToPay = $t01517515483._1 | |
478 | + | let assetToPay = $t01517515483._2 | |
479 | 479 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))))) | |
480 | 480 | invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPayWithFee)]) | |
481 | 481 | } | |
489 | 489 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = { | |
490 | 490 | let poolAddr = Address(fromBase58String(pool)) | |
491 | 491 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
492 | - | let $ | |
493 | - | let assetIdA = $ | |
494 | - | let assetIdB = $ | |
495 | - | let balA = $ | |
496 | - | let balB = $ | |
492 | + | let $t01634816415 = getPoolData(poolAddr, pType) | |
493 | + | let assetIdA = $t01634816415._1 | |
494 | + | let assetIdB = $t01634816415._2 | |
495 | + | let balA = $t01634816415._3 | |
496 | + | let balB = $t01634816415._4 | |
497 | 497 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
498 | 498 | if ((cBalABefore == cBalABefore)) | |
499 | 499 | then { | |
509 | 509 | then { | |
510 | 510 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
511 | 511 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
512 | - | let $ | |
513 | - | let tokensAmountA = $ | |
514 | - | let tokensAmountB = $ | |
515 | - | let $ | |
512 | + | let $t01692717016 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
513 | + | let tokensAmountA = $t01692717016._1 | |
514 | + | let tokensAmountB = $t01692717016._2 | |
515 | + | let $t01701917715 = if ((debt > 0)) | |
516 | 516 | then { | |
517 | 517 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
518 | 518 | then (debt > tokensAmountA) | |
535 | 535 | else throw("Strict value is not equal to itself.") | |
536 | 536 | } | |
537 | 537 | else $Tuple2(tokensAmountA, tokensAmountB) | |
538 | - | let toUserAmountA = $ | |
539 | - | let toUserAmountB = $ | |
538 | + | let toUserAmountA = $t01701917715._1 | |
539 | + | let toUserAmountB = $t01701917715._2 | |
540 | 540 | $Tuple4(toUserAmountA, assetIdA, toUserAmountB, assetIdB) | |
541 | 541 | } | |
542 | 542 | else throw("Strict value is not equal to itself.") | |
554 | 554 | then throw("Leverage can't be <100 and >300") | |
555 | 555 | else { | |
556 | 556 | let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
557 | - | let $ | |
558 | - | let AId = $ | |
559 | - | let BId = $ | |
560 | - | let balA = $ | |
561 | - | let balB = $ | |
562 | - | let shareId = $ | |
563 | - | let $ | |
557 | + | let $t01807818167 = getPoolData(Address(fromBase58String(pool)), type) | |
558 | + | let AId = $t01807818167._1 | |
559 | + | let BId = $t01807818167._2 | |
560 | + | let balA = $t01807818167._3 | |
561 | + | let balB = $t01807818167._4 | |
562 | + | let shareId = $t01807818167._5 | |
563 | + | let $t01817018807 = if ((size(i.payments) == 2)) | |
564 | 564 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
565 | 565 | then throw("Wrong payment asset A") | |
566 | 566 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
573 | 573 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
574 | 574 | else throw("Wrong payment") | |
575 | 575 | else throw("One or two payments expected") | |
576 | - | let pmtA = $ | |
577 | - | let pmtAssetA = $ | |
578 | - | let pmtB = $ | |
579 | - | let pmtAssetB = $ | |
580 | - | let $ | |
576 | + | let pmtA = $t01817018807._1 | |
577 | + | let pmtAssetA = $t01817018807._2 | |
578 | + | let pmtB = $t01817018807._3 | |
579 | + | let pmtAssetB = $t01817018807._4 | |
580 | + | let $t01881019563 = if ((leverage > 100)) | |
581 | 581 | then { | |
582 | 582 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
583 | 583 | if ($isInstanceOf(@, "(Int, Int)")) | |
594 | 594 | else $Tuple4(pmtA, (pmtB + borrowAmount), LOAN_FEE, borrowAmount) | |
595 | 595 | } | |
596 | 596 | else $Tuple4(pmtA, pmtB, NO_LOAN_FEE, 0) | |
597 | - | let paymentA = $ | |
598 | - | let paymentB = $ | |
599 | - | let feeType = $ | |
600 | - | let borrowAmount = $ | |
601 | - | let $ | |
597 | + | let paymentA = $t01881019563._1 | |
598 | + | let paymentB = $t01881019563._2 | |
599 | + | let feeType = $t01881019563._3 | |
600 | + | let borrowAmount = $t01881019563._4 | |
601 | + | let $t01956619960 = if ((type == SF_POOL)) | |
602 | 602 | then replenishSwopFi(pool, feeType, paymentA, pmtAssetA, paymentB, pmtAssetB, balA, balB, shareId) | |
603 | 603 | else replenishWX(pool, feeType, pmtA, pmtAssetA, pmtB, pmtAssetB, shareId) | |
604 | - | let userStaked = $ | |
605 | - | let axlyFee = $ | |
606 | - | let $ | |
607 | - | if (($ | |
604 | + | let userStaked = $t01956619960._1 | |
605 | + | let axlyFee = $t01956619960._2 | |
606 | + | let $t01996120086 = withdrawAmountCalc(pool, userStaked, borrowAmount, borrowAssetId) | |
607 | + | if (($t01996120086 == $t01996120086)) | |
608 | 608 | then { | |
609 | - | let assetIdB = $ | |
610 | - | let toUserAmountB = $ | |
611 | - | let assetIdA = $ | |
612 | - | let toUserAmountA = $ | |
613 | - | $Tuple2(nil, | |
609 | + | let assetIdB = $t01996120086._4 | |
610 | + | let toUserAmountB = $t01996120086._3 | |
611 | + | let assetIdA = $t01996120086._2 | |
612 | + | let toUserAmountA = $t01996120086._1 | |
613 | + | $Tuple2(nil, [userStaked, toUserAmountA, toUserAmountB]) | |
614 | 614 | } | |
615 | 615 | else throw("Strict value is not equal to itself.") | |
616 | 616 | } | |
624 | 624 | then throw("Leverage can't be <100 and >300") | |
625 | 625 | else { | |
626 | 626 | let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
627 | - | let $ | |
628 | - | let AId = $ | |
629 | - | let BId = $ | |
630 | - | let balA = $ | |
631 | - | let balB = $ | |
632 | - | let shareId = $ | |
633 | - | let $ | |
627 | + | let $t02044220531 = getPoolData(Address(fromBase58String(pool)), type) | |
628 | + | let AId = $t02044220531._1 | |
629 | + | let BId = $t02044220531._2 | |
630 | + | let balA = $t02044220531._3 | |
631 | + | let balB = $t02044220531._4 | |
632 | + | let shareId = $t02044220531._5 | |
633 | + | let $t02053421171 = if ((size(i.payments) == 2)) | |
634 | 634 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
635 | 635 | then throw("Wrong payment asset A") | |
636 | 636 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
643 | 643 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
644 | 644 | else throw("Wrong payment") | |
645 | 645 | else throw("One or two payments expected") | |
646 | - | let pmtA = $ | |
647 | - | let pmtAssetA = $ | |
648 | - | let pmtB = $ | |
649 | - | let pmtAssetB = $ | |
646 | + | let pmtA = $t02053421171._1 | |
647 | + | let pmtAssetA = $t02053421171._2 | |
648 | + | let pmtB = $t02053421171._3 | |
649 | + | let pmtAssetB = $t02053421171._4 | |
650 | 650 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
651 | 651 | if ((leverage > 100)) | |
652 | 652 | then { | |
678 | 678 | else throw("Strict value is not equal to itself.") | |
679 | 679 | } | |
680 | 680 | else { | |
681 | - | let $ | |
681 | + | let $t02251222903 = if ((type == SF_POOL)) | |
682 | 682 | then replenishSwopFi(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, balA, balB, shareId) | |
683 | 683 | else replenishWX(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, shareId) | |
684 | - | let userStaked = $ | |
685 | - | let axlyFee = $ | |
684 | + | let userStaked = $t02251222903._1 | |
685 | + | let axlyFee = $t02251222903._2 | |
686 | 686 | replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, type) | |
687 | 687 | } | |
688 | 688 | } | |
709 | 709 | let user = request[1] | |
710 | 710 | let shareId = request[9] | |
711 | 711 | let posNum = parseIntValue(request[12]) | |
712 | - | let $ | |
712 | + | let $t02386124376 = if ((request[0] == SF_POOL)) | |
713 | 713 | then replenishSwopFi(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], parseIntValue(request[7]), parseIntValue(request[8]), shareId) | |
714 | 714 | else if ((request[0] == WX_POOL)) | |
715 | 715 | then replenishWX(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], shareId) | |
716 | 716 | else throw("Wrong request type") | |
717 | - | let userStaked = $ | |
718 | - | let axlyFee = $ | |
717 | + | let userStaked = $t02386124376._1 | |
718 | + | let axlyFee = $t02386124376._2 | |
719 | 719 | let borrowEntries = [IntegerEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAmount), i.payments[0].amount), StringEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAssetId), request[10])] | |
720 | 720 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, request[0]) | |
721 | 721 | $Tuple2(((entries ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
743 | 743 | else throw(($getType(@) + " couldn't be cast to Int")) | |
744 | 744 | } | |
745 | 745 | else 0 | |
746 | - | let $ | |
747 | - | if (($ | |
746 | + | let $t02578325903 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset) | |
747 | + | if (($t02578325903 == $t02578325903)) | |
748 | 748 | then { | |
749 | - | let assetIdB = $ | |
750 | - | let toUserAmountB = $ | |
751 | - | let assetIdA = $ | |
752 | - | let toUserAmountA = $ | |
749 | + | let assetIdB = $t02578325903._4 | |
750 | + | let toUserAmountB = $t02578325903._3 | |
751 | + | let assetIdA = $t02578325903._2 | |
752 | + | let toUserAmountA = $t02578325903._1 | |
753 | 753 | let closeDbtInv = if ((debt > 0)) | |
754 | 754 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + toString(posId))], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
755 | 755 | else 0 | |
772 | 772 | ||
773 | 773 | @Callable(i) | |
774 | 774 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
775 | - | let $ | |
775 | + | let $t02720027394 = if (claim) | |
776 | 776 | then claimFarmed(type, pool) | |
777 | 777 | else { | |
778 | 778 | let claimedAsset = if ((type == SF_POOL)) | |
780 | 780 | else WXID | |
781 | 781 | $Tuple2(amountToExchange, claimedAsset) | |
782 | 782 | } | |
783 | - | let claimedAmount = $ | |
784 | - | let claimedAsset = $ | |
783 | + | let claimedAmount = $t02720027394._1 | |
784 | + | let claimedAsset = $t02720027394._2 | |
785 | 785 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
786 | 786 | let change = (claimedAmount - amountToExchange) | |
787 | 787 | let changeEntry = if ((change > 0)) | |
794 | 794 | ||
795 | 795 | @Callable(i) | |
796 | 796 | func capitalizeExPazzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
797 | - | let $ | |
797 | + | let $t02805028244 = if (claim) | |
798 | 798 | then claimFarmed(type, pool) | |
799 | 799 | else { | |
800 | 800 | let claimedAsset = if ((type == SF_POOL)) | |
802 | 802 | else WXID | |
803 | 803 | $Tuple2(amountToExchange, claimedAsset) | |
804 | 804 | } | |
805 | - | let claimedAmount = $ | |
806 | - | let claimedAsset = $ | |
805 | + | let claimedAmount = $t02805028244._1 | |
806 | + | let claimedAsset = $t02805028244._2 | |
807 | 807 | let exchangedAmount = exchangePazzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
808 | 808 | let change = (claimedAmount - amountToExchange) | |
809 | 809 | let changeEntry = if ((change > 0)) | |
816 | 816 | ||
817 | 817 | @Callable(i) | |
818 | 818 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
819 | - | let $ | |
819 | + | let $t02896729161 = if (claim) | |
820 | 820 | then claimFarmed(type, pool) | |
821 | 821 | else { | |
822 | 822 | let claimedAsset = if ((type == SF_POOL)) | |
824 | 824 | else WXID | |
825 | 825 | $Tuple2(amountToExchange, claimedAsset) | |
826 | 826 | } | |
827 | - | let claimedAmount = $ | |
828 | - | let claimedAsset = $ | |
827 | + | let claimedAmount = $t02896729161._1 | |
828 | + | let claimedAsset = $t02896729161._2 | |
829 | 829 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
830 | 830 | let change = (claimedAmount - amountToExchange) | |
831 | 831 | let changeEntry = if ((change > 0)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SF_POOL = "SF" | |
5 | 5 | ||
6 | 6 | let WX_POOL = "WX" | |
7 | 7 | ||
8 | 8 | let CAP_FEE = "cap" | |
9 | 9 | ||
10 | 10 | let LOAN_FEE = "loan" | |
11 | 11 | ||
12 | 12 | let NO_LOAN_FEE = "noLoan" | |
13 | 13 | ||
14 | 14 | let SCALE8 = 100000000 | |
15 | 15 | ||
16 | 16 | let SCALE10 = 10000000000 | |
17 | 17 | ||
18 | 18 | let FEE_SCALE6 = 1000000 | |
19 | 19 | ||
20 | 20 | let kSFPoolAAssetBalance = "A_asset_balance" | |
21 | 21 | ||
22 | 22 | let kSFPoolBAssetBalance = "B_asset_balance" | |
23 | 23 | ||
24 | 24 | let kSFPoolAAssetId = "A_asset_id" | |
25 | 25 | ||
26 | 26 | let kSFPoolBAssetId = "B_asset_id" | |
27 | 27 | ||
28 | 28 | let kSFPoolShareId = "share_asset_id" | |
29 | 29 | ||
30 | 30 | let kSFPoolFee = "commission" | |
31 | 31 | ||
32 | 32 | let kUserPosition = "_user_position" | |
33 | 33 | ||
34 | 34 | let kUserBorrowAmount = "_user_position_borrow_amount" | |
35 | 35 | ||
36 | 36 | let kUserBorrowAssetId = "_user_position_borrow_asset_id" | |
37 | 37 | ||
38 | 38 | let kUserPositionNum = "_user_position_number" | |
39 | 39 | ||
40 | 40 | let kUserPositionInterest = "_user_position_interest" | |
41 | 41 | ||
42 | 42 | let kPoolTotal = "_pool_total" | |
43 | 43 | ||
44 | 44 | let kPoolInterest = "_pool_interest" | |
45 | 45 | ||
46 | 46 | let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan" | |
47 | 47 | ||
48 | 48 | let kAxlyInFeeWithLoan = "_axly_fee_with_loan" | |
49 | 49 | ||
50 | 50 | let kAxlyCapFee = "_axly_fee_cap" | |
51 | 51 | ||
52 | 52 | let kRequestId = "_request_id" | |
53 | 53 | ||
54 | 54 | let kRequestIter = "requests_iter" | |
55 | 55 | ||
56 | 56 | let kPool = "pool_" | |
57 | 57 | ||
58 | 58 | let kPoolCapChange = "_pool_cap_change" | |
59 | 59 | ||
60 | 60 | let kMoneyBox = "axly_money_box" | |
61 | 61 | ||
62 | 62 | let kSFFarmingAddr = "swopfi_farming_addr" | |
63 | 63 | ||
64 | 64 | let kLendService = "lend_service_addr" | |
65 | 65 | ||
66 | 66 | let kPriceOracle = "price_oracle" | |
67 | 67 | ||
68 | 68 | let kExContract = "exchange_contract" | |
69 | 69 | ||
70 | 70 | let kWxSwapContract = "wx_swap_contract" | |
71 | 71 | ||
72 | 72 | let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address"))) | |
73 | 73 | ||
74 | 74 | let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address"))) | |
75 | 75 | ||
76 | 76 | let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address"))) | |
77 | 77 | ||
78 | 78 | let wxSwapContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kWxSwapContract), "No wx swap address"))) | |
79 | 79 | ||
80 | 80 | let SWOPID = base58'4W19ndijcc2CsQa9HGW2dfXKTVXhnneWWttxXrtjPmEp' | |
81 | 81 | ||
82 | 82 | let WXID = base58'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc' | |
83 | 83 | ||
84 | 84 | func isSelfCall (i) = if ((i.caller == this)) | |
85 | 85 | then unit | |
86 | 86 | else throw("Only contract itself can call this function") | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func accountBalance (assetId) = match assetId { | |
90 | 90 | case id: ByteVector => | |
91 | 91 | assetBalance(this, id) | |
92 | 92 | case waves: Unit => | |
93 | 93 | wavesBalance(this).available | |
94 | 94 | case _ => | |
95 | 95 | throw("Match error") | |
96 | 96 | } | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func getSFPoolData (poolAddr) = $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolAAssetBalance), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolBAssetBalance), "Can't get pool B asset balance"), valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id")) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func getWXPoolData (poolAddr) = { | |
103 | 103 | let cfg = { | |
104 | 104 | let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil) | |
105 | 105 | if ($isInstanceOf(@, "List[Any]")) | |
106 | 106 | then @ | |
107 | 107 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
108 | 108 | } | |
109 | 109 | if ((cfg == cfg)) | |
110 | 110 | then $Tuple5(valueOrErrorMessage({ | |
111 | 111 | let @ = cfg[4] | |
112 | 112 | if ($isInstanceOf(@, "String")) | |
113 | 113 | then @ | |
114 | 114 | else unit | |
115 | 115 | }, "Can't get pool A asset id"), valueOrErrorMessage({ | |
116 | 116 | let @ = cfg[5] | |
117 | 117 | if ($isInstanceOf(@, "String")) | |
118 | 118 | then @ | |
119 | 119 | else unit | |
120 | 120 | }, "Can't get pool B asset id"), 0, 0, valueOrErrorMessage({ | |
121 | 121 | let @ = cfg[3] | |
122 | 122 | if ($isInstanceOf(@, "String")) | |
123 | 123 | then @ | |
124 | 124 | else unit | |
125 | 125 | }, "Can't get pool LP asset id")) | |
126 | 126 | else throw("Strict value is not equal to itself.") | |
127 | 127 | } | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func getPoolData (poolAddr,type) = if ((type == SF_POOL)) | |
131 | 131 | then getSFPoolData(poolAddr) | |
132 | 132 | else if ((type == WX_POOL)) | |
133 | 133 | then getWXPoolData(poolAddr) | |
134 | 134 | else throw("Wrong pool type") | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func getNewUserPositionNumber (pool,user) = (valueOrElse(getInteger(this, (((pool + "_") + user) + kUserPositionNum)), 0) + 1) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func getAxlyFee (pool,feeType) = if ((feeType == "cap")) | |
144 | 144 | then getIntegerValue(this, (pool + kAxlyCapFee)) | |
145 | 145 | else if ((feeType == "loan")) | |
146 | 146 | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
147 | 147 | else if ((feeType == "noLoan")) | |
148 | 148 | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
149 | 149 | else throw("Wrong fee type") | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func getWXFarmingAddr (poolAddr) = { | |
156 | 156 | let fContract = Address(fromBase58String(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
157 | 157 | let factroyCfg = split(valueOrErrorMessage(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
158 | 158 | Address(fromBase58String(factroyCfg[1])) | |
159 | 159 | } | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr"))) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func assetIdToStr (assetId) = match assetId { | |
166 | 166 | case id: ByteVector => | |
167 | 167 | toBase58String(id) | |
168 | 168 | case waves: Unit => | |
169 | 169 | "WAVES" | |
170 | 170 | case _ => | |
171 | 171 | throw("Match error") | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func assetIdFromStr (assetId) = if ((assetId == "WAVES")) | |
176 | 176 | then unit | |
177 | 177 | else fromBase58String(assetId) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
181 | 181 | then 8 | |
182 | 182 | else match assetInfo(fromBase58String(assetId)) { | |
183 | 183 | case asset: Asset => | |
184 | 184 | asset.decimals | |
185 | 185 | case _ => | |
186 | 186 | throw("Can't find asset") | |
187 | 187 | } | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func replenishSwopFi (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,balA,balB,shareId) = { | |
191 | 191 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
192 | 192 | if ((shareBalanceBefore == shareBalanceBefore)) | |
193 | 193 | then { | |
194 | 194 | let poolAddr = Address(fromBase58String(pool)) | |
195 | 195 | let ratioA = fraction(SCALE8, pmtA, balA) | |
196 | 196 | let ratioB = fraction(SCALE8, pmtB, balB) | |
197 | 197 | let $t063976689 = if ((ratioB > ratioA)) | |
198 | 198 | then { | |
199 | 199 | let pmt = fraction(balB, ratioA, SCALE8, CEILING) | |
200 | 200 | $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB) | |
201 | 201 | } | |
202 | 202 | else { | |
203 | 203 | let pmt = fraction(balA, ratioB, SCALE8, CEILING) | |
204 | 204 | $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA) | |
205 | 205 | } | |
206 | 206 | let pmtAmountA = $t063976689._1 | |
207 | 207 | let pmtAmountB = $t063976689._2 | |
208 | 208 | let change = $t063976689._3 | |
209 | 209 | let changeAssetId = $t063976689._4 | |
210 | 210 | let inv1 = if (if ((pmtAmountA > 0)) | |
211 | 211 | then (pmtAmountB > 0) | |
212 | 212 | else false) | |
213 | 213 | then { | |
214 | 214 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
215 | 215 | invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
216 | 216 | } | |
217 | 217 | else 0 | |
218 | 218 | if ((inv1 == inv1)) | |
219 | 219 | then { | |
220 | 220 | let inv2 = if ((change > 0)) | |
221 | 221 | then { | |
222 | 222 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
223 | 223 | let vars = ["0", "false", "0"] | |
224 | 224 | invoke(poolAddr, "callFunction", ["replenishWithOneToken", vars], payments) | |
225 | 225 | } | |
226 | 226 | else 0 | |
227 | 227 | if ((inv2 == inv2)) | |
228 | 228 | then { | |
229 | 229 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
230 | 230 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
231 | 231 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
232 | 232 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
233 | 233 | if ((0 >= userShareForStake)) | |
234 | 234 | then throw("amount of staked sharetokens must be > 0") | |
235 | 235 | else { | |
236 | 236 | let inv3 = invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
237 | 237 | if ((inv3 == inv3)) | |
238 | 238 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
239 | 239 | else throw("Strict value is not equal to itself.") | |
240 | 240 | } | |
241 | 241 | } | |
242 | 242 | else throw("Strict value is not equal to itself.") | |
243 | 243 | } | |
244 | 244 | else throw("Strict value is not equal to itself.") | |
245 | 245 | } | |
246 | 246 | else throw("Strict value is not equal to itself.") | |
247 | 247 | } | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func replenishWX (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,shareId) = { | |
251 | 251 | let poolAddr = Address(fromBase58String(pool)) | |
252 | 252 | let $t081408989 = if (if ((pmtA > 0)) | |
253 | 253 | then (pmtB > 0) | |
254 | 254 | else false) | |
255 | 255 | then { | |
256 | 256 | let evalPutInA = split({ | |
257 | 257 | let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil) | |
258 | 258 | if ($isInstanceOf(@, "String")) | |
259 | 259 | then @ | |
260 | 260 | else throw(($getType(@) + " couldn't be cast to String")) | |
261 | 261 | }, "__") | |
262 | 262 | if ((evalPutInA == evalPutInA)) | |
263 | 263 | then { | |
264 | 264 | let evalPutInB = split({ | |
265 | 265 | let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil) | |
266 | 266 | if ($isInstanceOf(@, "String")) | |
267 | 267 | then @ | |
268 | 268 | else throw(($getType(@) + " couldn't be cast to String")) | |
269 | 269 | }, "__") | |
270 | 270 | if ((evalPutInB == evalPutInB)) | |
271 | 271 | then { | |
272 | 272 | let lpInA = parseIntValue(evalPutInA[1]) | |
273 | 273 | let lpInB = parseIntValue(evalPutInB[1]) | |
274 | 274 | if ((lpInB > lpInA)) | |
275 | 275 | then { | |
276 | 276 | let pmtInB = parseIntValue(evalPutInA[8]) | |
277 | 277 | $Tuple4(pmtA, pmtInB, (pmtB - pmtInB), pmtAssetB) | |
278 | 278 | } | |
279 | 279 | else { | |
280 | 280 | let pmtInA = parseIntValue(evalPutInB[7]) | |
281 | 281 | $Tuple4(pmtInA, pmtB, (pmtA - pmtInA), pmtAssetA) | |
282 | 282 | } | |
283 | 283 | } | |
284 | 284 | else throw("Strict value is not equal to itself.") | |
285 | 285 | } | |
286 | 286 | else throw("Strict value is not equal to itself.") | |
287 | 287 | } | |
288 | 288 | else if ((pmtA > 0)) | |
289 | 289 | then $Tuple4(pmtA, pmtB, pmtA, pmtAssetA) | |
290 | 290 | else if ((pmtB > 0)) | |
291 | 291 | then $Tuple4(pmtA, pmtB, pmtB, pmtAssetB) | |
292 | 292 | else throw("pmts must be > 0") | |
293 | 293 | let pmtAmountA = $t081408989._1 | |
294 | 294 | let pmtAmountB = $t081408989._2 | |
295 | 295 | let change = $t081408989._3 | |
296 | 296 | let changeAssetId = $t081408989._4 | |
297 | 297 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
298 | 298 | if ((shareBalanceBefore == shareBalanceBefore)) | |
299 | 299 | then { | |
300 | 300 | let inv1 = if (if ((pmtAmountA > 0)) | |
301 | 301 | then (pmtAmountB > 0) | |
302 | 302 | else false) | |
303 | 303 | then { | |
304 | 304 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
305 | 305 | invoke(poolAddr, "put", [1000000, false], payments) | |
306 | 306 | } | |
307 | 307 | else 0 | |
308 | 308 | if ((inv1 == inv1)) | |
309 | 309 | then { | |
310 | 310 | let inv2 = if ((change > 0)) | |
311 | 311 | then { | |
312 | 312 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
313 | 313 | invoke(poolAddr, "putOneTkn", [0, false], payments) | |
314 | 314 | } | |
315 | 315 | else 0 | |
316 | 316 | if ((inv2 == inv2)) | |
317 | 317 | then { | |
318 | 318 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
319 | 319 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
320 | 320 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
321 | 321 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
322 | 322 | if ((0 >= userShareForStake)) | |
323 | 323 | then throw("amount of staked sharetokens must be > 0") | |
324 | 324 | else { | |
325 | 325 | let inv3 = invoke(getWXFarmingAddr(poolAddr), "stake", nil, [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
326 | 326 | if ((inv3 == inv3)) | |
327 | 327 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
328 | 328 | else throw("Strict value is not equal to itself.") | |
329 | 329 | } | |
330 | 330 | } | |
331 | 331 | else throw("Strict value is not equal to itself.") | |
332 | 332 | } | |
333 | 333 | else throw("Strict value is not equal to itself.") | |
334 | 334 | } | |
335 | 335 | else throw("Strict value is not equal to itself.") | |
336 | 336 | } | |
337 | 337 | ||
338 | 338 | ||
339 | 339 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type) = { | |
340 | 340 | let totalAmount = getPoolTotalShare(pool) | |
341 | 341 | let curPoolInterest = getIntegerValue(this, (pool + kPoolInterest)) | |
342 | 342 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), IntegerEntry((((pool + "_") + user) + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
343 | 343 | } | |
344 | 344 | ||
345 | 345 | ||
346 | 346 | func claimFarmed (type,pool) = if ((type == SF_POOL)) | |
347 | 347 | then { | |
348 | 348 | let balBefore = accountBalance(SWOPID) | |
349 | 349 | if ((balBefore == balBefore)) | |
350 | 350 | then { | |
351 | 351 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
352 | 352 | if ((inv == inv)) | |
353 | 353 | then { | |
354 | 354 | let balAfter = accountBalance(SWOPID) | |
355 | 355 | $Tuple2((balAfter - balBefore), SWOPID) | |
356 | 356 | } | |
357 | 357 | else throw("Strict value is not equal to itself.") | |
358 | 358 | } | |
359 | 359 | else throw("Strict value is not equal to itself.") | |
360 | 360 | } | |
361 | 361 | else if ((type == WX_POOL)) | |
362 | 362 | then { | |
363 | 363 | let balBefore = accountBalance(WXID) | |
364 | 364 | if ((balBefore == balBefore)) | |
365 | 365 | then { | |
366 | 366 | let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil) | |
367 | 367 | if ((inv == inv)) | |
368 | 368 | then { | |
369 | 369 | let balAfter = accountBalance(WXID) | |
370 | 370 | $Tuple2((balAfter - balBefore), WXID) | |
371 | 371 | } | |
372 | 372 | else throw("Strict value is not equal to itself.") | |
373 | 373 | } | |
374 | 374 | else throw("Strict value is not equal to itself.") | |
375 | 375 | } | |
376 | 376 | else throw("Wrong pool type") | |
377 | 377 | ||
378 | 378 | ||
379 | 379 | func exchangeKeeper (toToken,pmtAmount,pmtAsset,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
380 | 380 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
381 | 381 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
382 | 382 | then { | |
383 | 383 | let inv = invoke(exContract, "swap", [amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
384 | 384 | if ((inv == inv)) | |
385 | 385 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
386 | 386 | else throw("Strict value is not equal to itself.") | |
387 | 387 | } | |
388 | 388 | else throw("Strict value is not equal to itself.") | |
389 | 389 | } | |
390 | 390 | ||
391 | 391 | ||
392 | 392 | func exchangePazzle (toToken,pmtAmount,pmtAsset,routesStr,minToReceive,options) = { | |
393 | 393 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
394 | 394 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
395 | 395 | then { | |
396 | 396 | let inv = invoke(exContract, "puzzleSwap", [routesStr, minToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
397 | 397 | if ((inv == inv)) | |
398 | 398 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
399 | 399 | else throw("Strict value is not equal to itself.") | |
400 | 400 | } | |
401 | 401 | else throw("Strict value is not equal to itself.") | |
402 | 402 | } | |
403 | 403 | ||
404 | 404 | ||
405 | 405 | func exchangeSwopFi (toToken,pmtAmount,pmtAsset,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
406 | 406 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
407 | 407 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
408 | 408 | then { | |
409 | 409 | let inv = invoke(exContract, "swopfiSwap", [exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
410 | 410 | if ((inv == inv)) | |
411 | 411 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
412 | 412 | else throw("Strict value is not equal to itself.") | |
413 | 413 | } | |
414 | 414 | else throw("Strict value is not equal to itself.") | |
415 | 415 | } | |
416 | 416 | ||
417 | 417 | ||
418 | 418 | func capitalize (pool,type,tokenId,tokenAmount) = { | |
419 | 419 | let poolAddr = Address(fromBase58String(pool)) | |
420 | 420 | let $t01319013268 = getPoolData(poolAddr, type) | |
421 | 421 | let AId = $t01319013268._1 | |
422 | 422 | let BId = $t01319013268._2 | |
423 | 423 | let balA = $t01319013268._3 | |
424 | 424 | let balB = $t01319013268._4 | |
425 | 425 | let shareId = $t01319013268._5 | |
426 | 426 | let $t01327113351 = if ((tokenId == AId)) | |
427 | 427 | then $Tuple2(tokenAmount, 0) | |
428 | 428 | else $Tuple2(0, tokenAmount) | |
429 | 429 | let pmtA = $t01327113351._1 | |
430 | 430 | let pmtB = $t01327113351._2 | |
431 | 431 | let $t01335413715 = if ((type == SF_POOL)) | |
432 | 432 | then replenishSwopFi(pool, CAP_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
433 | 433 | else replenishWX(pool, CAP_FEE, pmtA, AId, pmtB, BId, shareId) | |
434 | 434 | let stakedAmount = $t01335413715._1 | |
435 | 435 | let axlyFee = $t01335413715._2 | |
436 | 436 | let curPoolInterest = valueOrElse(getInteger(this, (pool + kPoolInterest)), 0) | |
437 | 437 | let totalShareAmount = getPoolTotalShare(pool) | |
438 | 438 | let newInterest = (curPoolInterest + fraction(stakedAmount, SCALE10, totalShareAmount)) | |
439 | 439 | [IntegerEntry((pool + kPoolInterest), newInterest), ScriptTransfer(moneyBox, axlyFee, fromBase58String(shareId))] | |
440 | 440 | } | |
441 | 441 | ||
442 | 442 | ||
443 | 443 | func exchangeDirectlySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
444 | 444 | let poolAddr = Address(fromBase58String(pool)) | |
445 | 445 | let feeScale6 = 1000000 | |
446 | 446 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
447 | 447 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee)) | |
448 | 448 | let $t01440814696 = if ((assetTokenToGet == assetIdA)) | |
449 | 449 | then { | |
450 | 450 | let amountToPay = fraction(balA, amntGetNoFee, (balB - amntGetNoFee)) | |
451 | 451 | $Tuple2(amountToPay, assetIdB) | |
452 | 452 | } | |
453 | 453 | else { | |
454 | 454 | let amountToPay = fraction(balB, amntGetNoFee, (balA - amntGetNoFee)) | |
455 | 455 | $Tuple2(amountToPay, assetIdA) | |
456 | 456 | } | |
457 | 457 | let amountToPay = $t01440814696._1 | |
458 | 458 | let assetToPay = $t01440814696._2 | |
459 | - | invoke(poolAddr, "callFunction", ["exchange", "1"], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
459 | + | invoke(poolAddr, "callFunction", ["exchange", ["1"]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
460 | 460 | } | |
461 | 461 | ||
462 | 462 | ||
463 | 463 | func exchangeDirectlyWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
464 | 464 | let poolAddr = Address(fromBase58String(pool)) | |
465 | 465 | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
466 | 466 | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
467 | 467 | let feeScale = toBigInt(100000000) | |
468 | - | let $ | |
468 | + | let $t01517515483 = if ((assetTokenToGet == assetIdA)) | |
469 | 469 | then { | |
470 | 470 | let amountToPay = fraction(balA, amountTokenToGet, (balB - amountTokenToGet)) | |
471 | 471 | $Tuple2(amountToPay, assetIdB) | |
472 | 472 | } | |
473 | 473 | else { | |
474 | 474 | let amountToPay = fraction(balB, amountTokenToGet, (balA - amountTokenToGet)) | |
475 | 475 | $Tuple2(amountToPay, assetIdA) | |
476 | 476 | } | |
477 | - | let amountToPay = $ | |
478 | - | let assetToPay = $ | |
477 | + | let amountToPay = $t01517515483._1 | |
478 | + | let assetToPay = $t01517515483._2 | |
479 | 479 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))))) | |
480 | 480 | invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPayWithFee)]) | |
481 | 481 | } | |
482 | 482 | ||
483 | 483 | ||
484 | 484 | func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL)) | |
485 | 485 | then exchangeDirectlySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
486 | 486 | else exchangeDirectlyWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
487 | 487 | ||
488 | 488 | ||
489 | 489 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = { | |
490 | 490 | let poolAddr = Address(fromBase58String(pool)) | |
491 | 491 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
492 | - | let $ | |
493 | - | let assetIdA = $ | |
494 | - | let assetIdB = $ | |
495 | - | let balA = $ | |
496 | - | let balB = $ | |
492 | + | let $t01634816415 = getPoolData(poolAddr, pType) | |
493 | + | let assetIdA = $t01634816415._1 | |
494 | + | let assetIdB = $t01634816415._2 | |
495 | + | let balA = $t01634816415._3 | |
496 | + | let balB = $t01634816415._4 | |
497 | 497 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
498 | 498 | if ((cBalABefore == cBalABefore)) | |
499 | 499 | then { | |
500 | 500 | let cBalBBefore = accountBalance(assetIdFromStr(assetIdB)) | |
501 | 501 | if ((cBalBBefore == cBalBBefore)) | |
502 | 502 | then { | |
503 | 503 | let inv = if ((pType == SF_POOL)) | |
504 | 504 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
505 | 505 | else if ((pType == WX_POOL)) | |
506 | 506 | then invoke(poolAddr, "unstakeAndGet", [userCanWithdraw], nil) | |
507 | 507 | else throw("Wrong position type") | |
508 | 508 | if ((inv == inv)) | |
509 | 509 | then { | |
510 | 510 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
511 | 511 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
512 | - | let $ | |
513 | - | let tokensAmountA = $ | |
514 | - | let tokensAmountB = $ | |
515 | - | let $ | |
512 | + | let $t01692717016 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
513 | + | let tokensAmountA = $t01692717016._1 | |
514 | + | let tokensAmountB = $t01692717016._2 | |
515 | + | let $t01701917715 = if ((debt > 0)) | |
516 | 516 | then { | |
517 | 517 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
518 | 518 | then (debt > tokensAmountA) | |
519 | 519 | else false) | |
520 | 520 | then (debt - tokensAmountA) | |
521 | 521 | else if (if ((borrowAsset == assetIdB)) | |
522 | 522 | then (debt > tokensAmountB) | |
523 | 523 | else false) | |
524 | 524 | then (debt - tokensAmountB) | |
525 | 525 | else 0 | |
526 | 526 | let exInv = if ((amountToGetEx > 0)) | |
527 | 527 | then exchangeDirectly(pType, pool, assetIdA, assetIdB, balA, balB, amountToGetEx, borrowAsset) | |
528 | 528 | else 0 | |
529 | 529 | if ((exInv == exInv)) | |
530 | 530 | then { | |
531 | 531 | let cBalAAfterRepay = accountBalance(assetIdFromStr(assetIdA)) | |
532 | 532 | let cBalBAfterRepay = accountBalance(assetIdFromStr(assetIdB)) | |
533 | 533 | $Tuple2((cBalAAfterRepay - cBalABefore), (cBalBAfterRepay - cBalBBefore)) | |
534 | 534 | } | |
535 | 535 | else throw("Strict value is not equal to itself.") | |
536 | 536 | } | |
537 | 537 | else $Tuple2(tokensAmountA, tokensAmountB) | |
538 | - | let toUserAmountA = $ | |
539 | - | let toUserAmountB = $ | |
538 | + | let toUserAmountA = $t01701917715._1 | |
539 | + | let toUserAmountB = $t01701917715._2 | |
540 | 540 | $Tuple4(toUserAmountA, assetIdA, toUserAmountB, assetIdB) | |
541 | 541 | } | |
542 | 542 | else throw("Strict value is not equal to itself.") | |
543 | 543 | } | |
544 | 544 | else throw("Strict value is not equal to itself.") | |
545 | 545 | } | |
546 | 546 | else throw("Strict value is not equal to itself.") | |
547 | 547 | } | |
548 | 548 | ||
549 | 549 | ||
550 | 550 | @Callable(i) | |
551 | 551 | func replenishREADONLY (pool,leverage,borrowAssetId) = if (if ((100 > leverage)) | |
552 | 552 | then true | |
553 | 553 | else (leverage > 300)) | |
554 | 554 | then throw("Leverage can't be <100 and >300") | |
555 | 555 | else { | |
556 | 556 | let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
557 | - | let $ | |
558 | - | let AId = $ | |
559 | - | let BId = $ | |
560 | - | let balA = $ | |
561 | - | let balB = $ | |
562 | - | let shareId = $ | |
563 | - | let $ | |
557 | + | let $t01807818167 = getPoolData(Address(fromBase58String(pool)), type) | |
558 | + | let AId = $t01807818167._1 | |
559 | + | let BId = $t01807818167._2 | |
560 | + | let balA = $t01807818167._3 | |
561 | + | let balB = $t01807818167._4 | |
562 | + | let shareId = $t01807818167._5 | |
563 | + | let $t01817018807 = if ((size(i.payments) == 2)) | |
564 | 564 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
565 | 565 | then throw("Wrong payment asset A") | |
566 | 566 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
567 | 567 | then throw("Wrong payment asset B") | |
568 | 568 | else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId) | |
569 | 569 | else if ((size(i.payments) == 1)) | |
570 | 570 | then if ((assetIdToStr(i.payments[0].assetId) == AId)) | |
571 | 571 | then $Tuple4(i.payments[0].amount, AId, 0, BId) | |
572 | 572 | else if ((assetIdToStr(i.payments[0].assetId) == BId)) | |
573 | 573 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
574 | 574 | else throw("Wrong payment") | |
575 | 575 | else throw("One or two payments expected") | |
576 | - | let pmtA = $ | |
577 | - | let pmtAssetA = $ | |
578 | - | let pmtB = $ | |
579 | - | let pmtAssetB = $ | |
580 | - | let $ | |
576 | + | let pmtA = $t01817018807._1 | |
577 | + | let pmtAssetA = $t01817018807._2 | |
578 | + | let pmtB = $t01817018807._3 | |
579 | + | let pmtAssetB = $t01817018807._4 | |
580 | + | let $t01881019563 = if ((leverage > 100)) | |
581 | 581 | then { | |
582 | 582 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
583 | 583 | if ($isInstanceOf(@, "(Int, Int)")) | |
584 | 584 | then @ | |
585 | 585 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
586 | 586 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetB, false], nil) | |
587 | 587 | if ($isInstanceOf(@, "(Int, Int)")) | |
588 | 588 | then @ | |
589 | 589 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
590 | 590 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(pmtAssetA), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(pmtAssetB), 0, 0, DOWN))) | |
591 | 591 | let borrowAmount = fraction(paydInDollar, (leverage - 100), 100) | |
592 | 592 | if ((borrowAssetId == pmtAssetA)) | |
593 | 593 | then $Tuple4((pmtA + borrowAmount), pmtB, LOAN_FEE, borrowAmount) | |
594 | 594 | else $Tuple4(pmtA, (pmtB + borrowAmount), LOAN_FEE, borrowAmount) | |
595 | 595 | } | |
596 | 596 | else $Tuple4(pmtA, pmtB, NO_LOAN_FEE, 0) | |
597 | - | let paymentA = $ | |
598 | - | let paymentB = $ | |
599 | - | let feeType = $ | |
600 | - | let borrowAmount = $ | |
601 | - | let $ | |
597 | + | let paymentA = $t01881019563._1 | |
598 | + | let paymentB = $t01881019563._2 | |
599 | + | let feeType = $t01881019563._3 | |
600 | + | let borrowAmount = $t01881019563._4 | |
601 | + | let $t01956619960 = if ((type == SF_POOL)) | |
602 | 602 | then replenishSwopFi(pool, feeType, paymentA, pmtAssetA, paymentB, pmtAssetB, balA, balB, shareId) | |
603 | 603 | else replenishWX(pool, feeType, pmtA, pmtAssetA, pmtB, pmtAssetB, shareId) | |
604 | - | let userStaked = $ | |
605 | - | let axlyFee = $ | |
606 | - | let $ | |
607 | - | if (($ | |
604 | + | let userStaked = $t01956619960._1 | |
605 | + | let axlyFee = $t01956619960._2 | |
606 | + | let $t01996120086 = withdrawAmountCalc(pool, userStaked, borrowAmount, borrowAssetId) | |
607 | + | if (($t01996120086 == $t01996120086)) | |
608 | 608 | then { | |
609 | - | let assetIdB = $ | |
610 | - | let toUserAmountB = $ | |
611 | - | let assetIdA = $ | |
612 | - | let toUserAmountA = $ | |
613 | - | $Tuple2(nil, | |
609 | + | let assetIdB = $t01996120086._4 | |
610 | + | let toUserAmountB = $t01996120086._3 | |
611 | + | let assetIdA = $t01996120086._2 | |
612 | + | let toUserAmountA = $t01996120086._1 | |
613 | + | $Tuple2(nil, [userStaked, toUserAmountA, toUserAmountB]) | |
614 | 614 | } | |
615 | 615 | else throw("Strict value is not equal to itself.") | |
616 | 616 | } | |
617 | 617 | ||
618 | 618 | ||
619 | 619 | ||
620 | 620 | @Callable(i) | |
621 | 621 | func replenish (pool,leverage,borrowAssetId) = if (if ((100 > leverage)) | |
622 | 622 | then true | |
623 | 623 | else (leverage > 300)) | |
624 | 624 | then throw("Leverage can't be <100 and >300") | |
625 | 625 | else { | |
626 | 626 | let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
627 | - | let $ | |
628 | - | let AId = $ | |
629 | - | let BId = $ | |
630 | - | let balA = $ | |
631 | - | let balB = $ | |
632 | - | let shareId = $ | |
633 | - | let $ | |
627 | + | let $t02044220531 = getPoolData(Address(fromBase58String(pool)), type) | |
628 | + | let AId = $t02044220531._1 | |
629 | + | let BId = $t02044220531._2 | |
630 | + | let balA = $t02044220531._3 | |
631 | + | let balB = $t02044220531._4 | |
632 | + | let shareId = $t02044220531._5 | |
633 | + | let $t02053421171 = if ((size(i.payments) == 2)) | |
634 | 634 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
635 | 635 | then throw("Wrong payment asset A") | |
636 | 636 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
637 | 637 | then throw("Wrong payment asset B") | |
638 | 638 | else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId) | |
639 | 639 | else if ((size(i.payments) == 1)) | |
640 | 640 | then if ((assetIdToStr(i.payments[0].assetId) == AId)) | |
641 | 641 | then $Tuple4(i.payments[0].amount, AId, 0, BId) | |
642 | 642 | else if ((assetIdToStr(i.payments[0].assetId) == BId)) | |
643 | 643 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
644 | 644 | else throw("Wrong payment") | |
645 | 645 | else throw("One or two payments expected") | |
646 | - | let pmtA = $ | |
647 | - | let pmtAssetA = $ | |
648 | - | let pmtB = $ | |
649 | - | let pmtAssetB = $ | |
646 | + | let pmtA = $t02053421171._1 | |
647 | + | let pmtAssetA = $t02053421171._2 | |
648 | + | let pmtB = $t02053421171._3 | |
649 | + | let pmtAssetB = $t02053421171._4 | |
650 | 650 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
651 | 651 | if ((leverage > 100)) | |
652 | 652 | then { | |
653 | 653 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
654 | 654 | if ($isInstanceOf(@, "(Int, Int)")) | |
655 | 655 | then @ | |
656 | 656 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
657 | 657 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetB, false], nil) | |
658 | 658 | if ($isInstanceOf(@, "(Int, Int)")) | |
659 | 659 | then @ | |
660 | 660 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
661 | 661 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(pmtAssetA), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(pmtAssetB), 0, 0, DOWN))) | |
662 | 662 | let borrowAmount = fraction(paydInDollar, (leverage - 100), 100) | |
663 | 663 | let request = makeString([type, toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowAssetId, toString(borrowAmount), toString(newPosNum)], ",") | |
664 | 664 | let newRequestId = { | |
665 | 665 | let @ = invoke(this, "createNewRequest", [request], nil) | |
666 | 666 | if ($isInstanceOf(@, "Int")) | |
667 | 667 | then @ | |
668 | 668 | else throw(($getType(@) + " couldn't be cast to Int")) | |
669 | 669 | } | |
670 | 670 | if ((newRequestId == newRequestId)) | |
671 | 671 | then { | |
672 | 672 | let args = [((toString(i.caller) + "_") + toString(newPosNum)), shareId, borrowAssetId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
673 | 673 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
674 | 674 | if ((inv == inv)) | |
675 | 675 | then nil | |
676 | 676 | else throw("Strict value is not equal to itself.") | |
677 | 677 | } | |
678 | 678 | else throw("Strict value is not equal to itself.") | |
679 | 679 | } | |
680 | 680 | else { | |
681 | - | let $ | |
681 | + | let $t02251222903 = if ((type == SF_POOL)) | |
682 | 682 | then replenishSwopFi(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, balA, balB, shareId) | |
683 | 683 | else replenishWX(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, shareId) | |
684 | - | let userStaked = $ | |
685 | - | let axlyFee = $ | |
684 | + | let userStaked = $t02251222903._1 | |
685 | + | let axlyFee = $t02251222903._2 | |
686 | 686 | replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, type) | |
687 | 687 | } | |
688 | 688 | } | |
689 | 689 | ||
690 | 690 | ||
691 | 691 | ||
692 | 692 | @Callable(i) | |
693 | 693 | func replenishFromLand (requestId) = { | |
694 | 694 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
695 | 695 | if ((size(i.payments) != 1)) | |
696 | 696 | then throw("Wrong payment size") | |
697 | 697 | else if (if ((assetIdToStr(i.payments[0].assetId) != request[10])) | |
698 | 698 | then true | |
699 | 699 | else (i.payments[0].amount != parseIntValue(request[11]))) | |
700 | 700 | then throw("Wrong payment") | |
701 | 701 | else { | |
702 | 702 | let pmtA = if ((request[4] == assetIdToStr(i.payments[0].assetId))) | |
703 | 703 | then (parseIntValue(request[3]) + i.payments[0].amount) | |
704 | 704 | else parseIntValue(request[3]) | |
705 | 705 | let pmtB = if ((request[6] == assetIdToStr(i.payments[0].assetId))) | |
706 | 706 | then (parseIntValue(request[5]) + i.payments[0].amount) | |
707 | 707 | else parseIntValue(request[3]) | |
708 | 708 | let pool = request[2] | |
709 | 709 | let user = request[1] | |
710 | 710 | let shareId = request[9] | |
711 | 711 | let posNum = parseIntValue(request[12]) | |
712 | - | let $ | |
712 | + | let $t02386124376 = if ((request[0] == SF_POOL)) | |
713 | 713 | then replenishSwopFi(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], parseIntValue(request[7]), parseIntValue(request[8]), shareId) | |
714 | 714 | else if ((request[0] == WX_POOL)) | |
715 | 715 | then replenishWX(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], shareId) | |
716 | 716 | else throw("Wrong request type") | |
717 | - | let userStaked = $ | |
718 | - | let axlyFee = $ | |
717 | + | let userStaked = $t02386124376._1 | |
718 | + | let axlyFee = $t02386124376._2 | |
719 | 719 | let borrowEntries = [IntegerEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAmount), i.payments[0].amount), StringEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAssetId), request[10])] | |
720 | 720 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, request[0]) | |
721 | 721 | $Tuple2(((entries ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
722 | 722 | } | |
723 | 723 | } | |
724 | 724 | ||
725 | 725 | ||
726 | 726 | ||
727 | 727 | @Callable(i) | |
728 | 728 | func withdraw (pool,posId) = { | |
729 | 729 | let user = toString(i.caller) | |
730 | 730 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), "Unknown position") | |
731 | 731 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)) | |
732 | 732 | let poolInterst = getIntegerValue(this, (pool + kPoolInterest)) | |
733 | 733 | let poolTotalShare = getPoolTotalShare(pool) | |
734 | 734 | let userCanWithdraw = (pAmount + fraction(pAmount, (poolInterst - userInterest), SCALE10)) | |
735 | 735 | let userAddr = Address(fromBase58String(user)) | |
736 | 736 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAmount)) | |
737 | 737 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAssetId)) | |
738 | 738 | let debt = if ((borrowAmount > 0)) | |
739 | 739 | then { | |
740 | 740 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((((pool + "_") + user) + "_") + toString(posId)), borrowAsset], nil) | |
741 | 741 | if ($isInstanceOf(@, "Int")) | |
742 | 742 | then @ | |
743 | 743 | else throw(($getType(@) + " couldn't be cast to Int")) | |
744 | 744 | } | |
745 | 745 | else 0 | |
746 | - | let $ | |
747 | - | if (($ | |
746 | + | let $t02578325903 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset) | |
747 | + | if (($t02578325903 == $t02578325903)) | |
748 | 748 | then { | |
749 | - | let assetIdB = $ | |
750 | - | let toUserAmountB = $ | |
751 | - | let assetIdA = $ | |
752 | - | let toUserAmountA = $ | |
749 | + | let assetIdB = $t02578325903._4 | |
750 | + | let toUserAmountB = $t02578325903._3 | |
751 | + | let assetIdA = $t02578325903._2 | |
752 | + | let toUserAmountA = $t02578325903._1 | |
753 | 753 | let closeDbtInv = if ((debt > 0)) | |
754 | 754 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + toString(posId))], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
755 | 755 | else 0 | |
756 | 756 | if ((closeDbtInv == closeDbtInv)) | |
757 | 757 | then [DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, toUserAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, toUserAmountB, assetIdFromStr(assetIdB))] | |
758 | 758 | else throw("Strict value is not equal to itself.") | |
759 | 759 | } | |
760 | 760 | else throw("Strict value is not equal to itself.") | |
761 | 761 | } | |
762 | 762 | ||
763 | 763 | ||
764 | 764 | ||
765 | 765 | @Callable(i) | |
766 | 766 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
767 | 767 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
768 | 768 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId) | |
769 | 769 | }) | |
770 | 770 | ||
771 | 771 | ||
772 | 772 | ||
773 | 773 | @Callable(i) | |
774 | 774 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
775 | - | let $ | |
775 | + | let $t02720027394 = if (claim) | |
776 | 776 | then claimFarmed(type, pool) | |
777 | 777 | else { | |
778 | 778 | let claimedAsset = if ((type == SF_POOL)) | |
779 | 779 | then SWOPID | |
780 | 780 | else WXID | |
781 | 781 | $Tuple2(amountToExchange, claimedAsset) | |
782 | 782 | } | |
783 | - | let claimedAmount = $ | |
784 | - | let claimedAsset = $ | |
783 | + | let claimedAmount = $t02720027394._1 | |
784 | + | let claimedAsset = $t02720027394._2 | |
785 | 785 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
786 | 786 | let change = (claimedAmount - amountToExchange) | |
787 | 787 | let changeEntry = if ((change > 0)) | |
788 | 788 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
789 | 789 | else nil | |
790 | 790 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
791 | 791 | } | |
792 | 792 | ||
793 | 793 | ||
794 | 794 | ||
795 | 795 | @Callable(i) | |
796 | 796 | func capitalizeExPazzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
797 | - | let $ | |
797 | + | let $t02805028244 = if (claim) | |
798 | 798 | then claimFarmed(type, pool) | |
799 | 799 | else { | |
800 | 800 | let claimedAsset = if ((type == SF_POOL)) | |
801 | 801 | then SWOPID | |
802 | 802 | else WXID | |
803 | 803 | $Tuple2(amountToExchange, claimedAsset) | |
804 | 804 | } | |
805 | - | let claimedAmount = $ | |
806 | - | let claimedAsset = $ | |
805 | + | let claimedAmount = $t02805028244._1 | |
806 | + | let claimedAsset = $t02805028244._2 | |
807 | 807 | let exchangedAmount = exchangePazzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
808 | 808 | let change = (claimedAmount - amountToExchange) | |
809 | 809 | let changeEntry = if ((change > 0)) | |
810 | 810 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
811 | 811 | else nil | |
812 | 812 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
813 | 813 | } | |
814 | 814 | ||
815 | 815 | ||
816 | 816 | ||
817 | 817 | @Callable(i) | |
818 | 818 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
819 | - | let $ | |
819 | + | let $t02896729161 = if (claim) | |
820 | 820 | then claimFarmed(type, pool) | |
821 | 821 | else { | |
822 | 822 | let claimedAsset = if ((type == SF_POOL)) | |
823 | 823 | then SWOPID | |
824 | 824 | else WXID | |
825 | 825 | $Tuple2(amountToExchange, claimedAsset) | |
826 | 826 | } | |
827 | - | let claimedAmount = $ | |
828 | - | let claimedAsset = $ | |
827 | + | let claimedAmount = $t02896729161._1 | |
828 | + | let claimedAsset = $t02896729161._2 | |
829 | 829 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
830 | 830 | let change = (claimedAmount - amountToExchange) | |
831 | 831 | let changeEntry = if ((change > 0)) | |
832 | 832 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
833 | 833 | else nil | |
834 | 834 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
835 | 835 | } | |
836 | 836 | ||
837 | 837 | ||
838 | 838 | ||
839 | 839 | @Callable(i) | |
840 | 840 | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFee) = if (if ((type != SF_POOL)) | |
841 | 841 | then (type != WX_POOL) | |
842 | 842 | else false) | |
843 | 843 | then throw("Wrong type") | |
844 | 844 | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), IntegerEntry((poolAddr + kPoolInterest), 0), StringEntry((kPool + poolAddr), type)] | |
845 | 845 | ||
846 | 846 | ||
847 | 847 | @Verifier(tx) | |
848 | 848 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
849 | 849 |
github/deemru/w8io/026f985 160.65 ms ◑