tx · 8fVbsihXeEptce76EkDhWxruJWUUAEwb8B7ZcpSoU7Ru 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.04300000 Waves 2023.06.26 13:06 [2639469] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "8fVbsihXeEptce76EkDhWxruJWUUAEwb8B7ZcpSoU7Ru", "fee": 4300000, "feeAssetId": null, "timestamp": 1687774004625, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "rcwPYA2BJDjf2smwgeDJjrztYk27HFSSbL6nTx2dfwvMKr6oPo2N8VSYMqeaiWcun2am3vC9TGkDwXPPNwX26FW" ], "script": "base64:BgKKAQgCEgcKBQgBCAEBEgMKAQgSBAoCCAgSBQoDCBgYEgUKAwgBCBIECgIIARIGCgQBCAgBEgUKAwEICBIDCgEIEgMKAQgSBQoDCAgBEgYKBAgBCAgSDgoMCAgIAQQRGBgRAQEYEgoKCAgICAEECAEYEg4KDAgICAEEGBgYGBgBGBIKCggICAEBAQEBAWYAB1NGX1BPT0wCAlNGAAdXWF9QT09MAgJXWAAPQ0FQX0ZFRV9OT19MT0FOAgljYXBOb0xvYW4ADENBUF9GRUVfTE9BTgIHY2FwTG9hbgAUU1RPUExPU1NfRkVFX05PX0xPQU4CDnN0b3BMb3NzTm9Mb2FuAA1TVE9QTE9TU19MT0FOAgxzdG9wTG9zc0xvYW4ACExPQU5fRkVFAgRsb2FuAAtOT19MT0FOX0ZFRQIGbm9Mb2FuAAZOT19GRUUCBW5vRmVlAAZTQ0FMRTgAgMLXLwAHU0NBTEUxMACAyK+gJQAHU0NBTEUxNgkAtgIBAICAhP6m3uERAApGRUVfU0NBTEU2AMCEPQAUa1NGUG9vbEFBc3NldEJhbGFuY2UCD0FfYXNzZXRf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ZVdpdGhMb2FuBQlpbkZlZUxvYW4JAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFEWtBeGx5Tm9Mb2FuQ2FwRmVlBQxjYXBGZWVOb0xvYW4JAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFE2tBeGx5V2l0aExvYW5DYXBGZWUFDmNhcEZlZVdpdGhMb2FuCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCHBvb2xBZGRyBRZrQXhseVN0b3BMb3NzTm9Mb2FuRmVlBRFzdG9wbG9zc0ZlZU5vTG9hbgkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQhwb29sQWRkcgUUa0F4bHlTdG9wTG9zc0xvYW5GZWUFE3N0b3Bsb3NzRmVlV2l0aExvYW4JAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFEWtQb29sSW50ZXJlc3RMb2FuAAAJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFE2tQb29sSW50ZXJlc3ROb0xvYW4AAAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFBWtQb29sBQhwb29sQWRkcgUEdHlwZQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFB3NoYXJlSWQFCmtTaGFyZVBvb2wFCHBvb2xBZGRyBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5nGUDwg==", "height": 2639469, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6D9wtUz83iSGDkhLU1GPC6C5RkFHETkmvyZZe5eXczrr Next: Bhw2WSb4a2xM5EtS1vbso9aBRhuQQif2o6KEcWhFg4GN Diff:
Old | New | Differences | |
---|---|---|---|
459 | 459 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee)) | |
460 | 460 | let $t01296913257 = if ((assetTokenToGet == assetIdA)) | |
461 | 461 | then { | |
462 | - | let amountToPay = fraction( | |
462 | + | let amountToPay = fraction(amntGetNoFee, balB, (balA - amntGetNoFee)) | |
463 | 463 | $Tuple2(amountToPay, assetIdB) | |
464 | 464 | } | |
465 | 465 | else { | |
466 | - | let amountToPay = fraction( | |
466 | + | let amountToPay = fraction(amntGetNoFee, balA, (balB - amntGetNoFee)) | |
467 | 467 | $Tuple2(amountToPay, assetIdA) | |
468 | 468 | } | |
469 | 469 | let amountToPay = $t01296913257._1 | |
476 | 476 | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
477 | 477 | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
478 | 478 | let feeScale = toBigInt(100000000) | |
479 | - | let $ | |
479 | + | let $t01359613903 = if ((assetTokenToGet == assetIdA)) | |
480 | 480 | then { | |
481 | - | let amountToPay = fraction( | |
481 | + | let amountToPay = fraction(amountTokenToGet, balB, (balA - amountTokenToGet)) | |
482 | 482 | $Tuple2(amountToPay, assetIdB) | |
483 | 483 | } | |
484 | 484 | else { | |
485 | - | let amountToPay = fraction( | |
485 | + | let amountToPay = fraction(amountTokenToGet, balA, (balB - amountTokenToGet)) | |
486 | 486 | $Tuple2(amountToPay, assetIdA) | |
487 | 487 | } | |
488 | - | let amountToPay = $ | |
489 | - | let assetToPay = $ | |
488 | + | let amountToPay = $t01359613903._1 | |
489 | + | let assetToPay = $t01359613903._2 | |
490 | 490 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))))) | |
491 | 491 | $Tuple2(assetToPay, amountToPayWithFee) | |
492 | 492 | } | |
494 | 494 | ||
495 | 495 | func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL)) | |
496 | 496 | then { | |
497 | - | let $ | |
498 | - | let assetToPay = $ | |
499 | - | let amountToPay = $ | |
497 | + | let $t01424114363 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
498 | + | let assetToPay = $t01424114363._1 | |
499 | + | let amountToPay = $t01424114363._2 | |
500 | 500 | invoke(addressFromStringValue(pool), "callFunction", ["exchange", ["1"]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
501 | 501 | } | |
502 | 502 | else { | |
503 | - | let $ | |
504 | - | let assetToPay = $ | |
505 | - | let amountToPay = $ | |
503 | + | let $t01451414636 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
504 | + | let assetToPay = $t01451414636._1 | |
505 | + | let amountToPay = $t01451414636._2 | |
506 | 506 | invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
507 | 507 | } | |
508 | 508 | ||
533 | 533 | } | |
534 | 534 | else if ((pType == WX_POOL)) | |
535 | 535 | then { | |
536 | - | let $ | |
536 | + | let $t01522415565 = if (if ((pmtA > 0)) | |
537 | 537 | then (pmtB > 0) | |
538 | 538 | else false) | |
539 | 539 | then { | |
540 | - | let $ | |
541 | - | let pmtInA = $ | |
542 | - | let pmtInB = $ | |
543 | - | let change = $ | |
544 | - | let changeId = $ | |
545 | - | let lpAmount = $ | |
540 | + | let $t01530515431 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
541 | + | let pmtInA = $t01530515431._1 | |
542 | + | let pmtInB = $t01530515431._2 | |
543 | + | let change = $t01530515431._3 | |
544 | + | let changeId = $t01530515431._4 | |
545 | + | let lpAmount = $t01530515431._5 | |
546 | 546 | $Tuple3(change, changeId, lpAmount) | |
547 | 547 | } | |
548 | 548 | else if ((pmtA > 0)) | |
549 | 549 | then $Tuple3(pmtA, aId, 0) | |
550 | 550 | else $Tuple3(pmtB, bId, 0) | |
551 | - | let change = $ | |
552 | - | let changeId = $ | |
553 | - | let lpTwo = $ | |
554 | - | let $ | |
551 | + | let change = $t01522415565._1 | |
552 | + | let changeId = $t01522415565._2 | |
553 | + | let lpTwo = $t01522415565._3 | |
554 | + | let $t01557215788 = if ((change > 0)) | |
555 | 555 | then { | |
556 | 556 | let inv = { | |
557 | 557 | let @ = invoke(poolAddr, "putOneTknREADONLY", [changeId, change], nil) | |
564 | 564 | else throw("Strict value is not equal to itself.") | |
565 | 565 | } | |
566 | 566 | else $Tuple2(0, 0) | |
567 | - | let lpOne = $ | |
568 | - | let loss = $ | |
567 | + | let lpOne = $t01557215788._1 | |
568 | + | let loss = $t01557215788._2 | |
569 | 569 | $Tuple2((lpTwo + lpOne), loss) | |
570 | 570 | } | |
571 | 571 | else throw("Wrong pool type") | |
574 | 574 | ||
575 | 575 | func calcWithdrawLPVirt (pType,pool,lpAmount,shareId,aId,bId,balA,balB,borrowAmount,borrowAssetId) = { | |
576 | 576 | let poolAddr = addressFromStringValue(pool) | |
577 | - | let $ | |
577 | + | let $t01608216582 = if ((pType == SF_POOL)) | |
578 | 578 | then { | |
579 | 579 | let inv = { | |
580 | 580 | let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(lpAmount), toString(balA), toString(balB)]], nil) | |
609 | 609 | else throw("Strict value is not equal to itself.") | |
610 | 610 | } | |
611 | 611 | else throw("Wrong pool type") | |
612 | - | let getAmountA = $ | |
613 | - | let getAmountB = $ | |
612 | + | let getAmountA = $t01608216582._1 | |
613 | + | let getAmountB = $t01608216582._2 | |
614 | 614 | if ((borrowAmount > 0)) | |
615 | 615 | then { | |
616 | 616 | let amountToGetEx = if (if ((borrowAssetId == aId)) | |
622 | 622 | else false) | |
623 | 623 | then (borrowAmount - getAmountB) | |
624 | 624 | else 0 | |
625 | - | let $ | |
625 | + | let $t01686017163 = if ((amountToGetEx > 0)) | |
626 | 626 | then if ((pType == SF_POOL)) | |
627 | 627 | then calcAmountToPaySF(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId) | |
628 | 628 | else calcAmountToPayWX(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId) | |
629 | 629 | else $Tuple2("", 0) | |
630 | - | let assetToPay = $ | |
631 | - | let amountToPay = $ | |
630 | + | let assetToPay = $t01686017163._1 | |
631 | + | let amountToPay = $t01686017163._2 | |
632 | 632 | if ((borrowAssetId == aId)) | |
633 | 633 | then $Tuple2(((getAmountA + amountToGetEx) - borrowAmount), (getAmountB - amountToPay)) | |
634 | 634 | else $Tuple2((getAmountA - amountToPay), ((getAmountB + amountToGetEx) - borrowAmount)) | |
675 | 675 | if ((lpBalanceBefore == lpBalanceBefore)) | |
676 | 676 | then { | |
677 | 677 | let poolAddr = addressFromStringValue(pool) | |
678 | - | let $ | |
678 | + | let $t01836018776 = if (if ((pmtA > 0)) | |
679 | 679 | then (pmtB > 0) | |
680 | 680 | else false) | |
681 | 681 | then { | |
682 | - | let $ | |
683 | - | let pmtInA = $ | |
684 | - | let pmtInB = $ | |
685 | - | let change = $ | |
686 | - | let changeId = $ | |
682 | + | let $t01842618542 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
683 | + | let pmtInA = $t01842618542._1 | |
684 | + | let pmtInB = $t01842618542._2 | |
685 | + | let change = $t01842618542._3 | |
686 | + | let changeId = $t01842618542._4 | |
687 | 687 | let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId) | |
688 | 688 | if ((inv == inv)) | |
689 | 689 | then $Tuple2(change, changeId) | |
694 | 694 | else if ((pmtB > 0)) | |
695 | 695 | then $Tuple2(pmtB, bId) | |
696 | 696 | else throw("pmts must be > 0") | |
697 | - | let change = $ | |
698 | - | let changeId = $ | |
697 | + | let change = $t01836018776._1 | |
698 | + | let changeId = $t01836018776._2 | |
699 | 699 | let inv = if ((change > 0)) | |
700 | 700 | then replenishOneTokenByType(poolAddr, pType, change, changeId) | |
701 | 701 | else nil | |
723 | 723 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = { | |
724 | 724 | let totalAmount = getPoolTotalShare(pool) | |
725 | 725 | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
726 | - | let $ | |
726 | + | let $t01963419872 = if (withLoan) | |
727 | 727 | then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount)) | |
728 | 728 | else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan) | |
729 | - | let curPoolInterest = $ | |
730 | - | let totalStakedWithLoan = $ | |
729 | + | let curPoolInterest = $t01963419872._1 | |
730 | + | let totalStakedWithLoan = $t01963419872._2 | |
731 | 731 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), totalStakedWithLoan), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), StringEntry((((user + "_") + toString(posNum)) + kUserPositionPool), pool), IntegerEntry((user + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
732 | 732 | } | |
733 | 733 | ||
773 | 773 | ||
774 | 774 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
775 | 775 | let poolAddr = Address(fromBase58String(pool)) | |
776 | - | let $ | |
777 | - | let AId = $ | |
778 | - | let BId = $ | |
779 | - | let balA = $ | |
780 | - | let balB = $ | |
781 | - | let shareId = $ | |
776 | + | let $t02222322289 = getPoolData(poolAddr, pType) | |
777 | + | let AId = $t02222322289._1 | |
778 | + | let BId = $t02222322289._2 | |
779 | + | let balA = $t02222322289._3 | |
780 | + | let balB = $t02222322289._4 | |
781 | + | let shareId = $t02222322289._5 | |
782 | 782 | if (if ((tokenId != AId)) | |
783 | 783 | then (tokenId != BId) | |
784 | 784 | else false) | |
785 | 785 | then throw("Wrong asset") | |
786 | 786 | else { | |
787 | - | let $ | |
787 | + | let $t02237422454 = if ((tokenId == AId)) | |
788 | 788 | then $Tuple2(tokenAmount, 0) | |
789 | 789 | else $Tuple2(0, tokenAmount) | |
790 | - | let pmtA = $ | |
791 | - | let pmtB = $ | |
792 | - | let $ | |
793 | - | let stakedAmount = $ | |
794 | - | let nf = $ | |
790 | + | let pmtA = $t02237422454._1 | |
791 | + | let pmtB = $t02237422454._2 | |
792 | + | let $t02245722561 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
793 | + | let stakedAmount = $t02245722561._1 | |
794 | + | let nf = $t02245722561._2 | |
795 | 795 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
796 | 796 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
797 | 797 | let totalShareAmount = getPoolTotalShare(pool) | |
818 | 818 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = { | |
819 | 819 | let poolAddr = Address(fromBase58String(pool)) | |
820 | 820 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
821 | - | let $ | |
822 | - | let assetIdA = $ | |
823 | - | let assetIdB = $ | |
824 | - | let balA = $ | |
825 | - | let balB = $ | |
826 | - | let shareId = $ | |
821 | + | let $t02432924405 = getPoolData(poolAddr, pType) | |
822 | + | let assetIdA = $t02432924405._1 | |
823 | + | let assetIdB = $t02432924405._2 | |
824 | + | let balA = $t02432924405._3 | |
825 | + | let balB = $t02432924405._4 | |
826 | + | let shareId = $t02432924405._5 | |
827 | 827 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
828 | 828 | if ((cBalABefore == cBalABefore)) | |
829 | 829 | then { | |
842 | 842 | then { | |
843 | 843 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
844 | 844 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
845 | - | let $ | |
846 | - | let tokensAmountA = $ | |
847 | - | let tokensAmountB = $ | |
848 | - | let $ | |
845 | + | let $t02496825057 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
846 | + | let tokensAmountA = $t02496825057._1 | |
847 | + | let tokensAmountB = $t02496825057._2 | |
848 | + | let $t02506025756 = if ((debt > 0)) | |
849 | 849 | then { | |
850 | 850 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
851 | 851 | then (debt > tokensAmountA) | |
868 | 868 | else throw("Strict value is not equal to itself.") | |
869 | 869 | } | |
870 | 870 | else $Tuple2(tokensAmountA, tokensAmountB) | |
871 | - | let toUserAmountA = $ | |
872 | - | let toUserAmountB = $ | |
871 | + | let toUserAmountA = $t02506025756._1 | |
872 | + | let toUserAmountB = $t02506025756._2 | |
873 | 873 | $Tuple7(toUserAmountA, assetIdA, toUserAmountB, assetIdB, cBalAAfter, cBalBAfter, shareId) | |
874 | 874 | } | |
875 | 875 | else throw("Strict value is not equal to itself.") | |
892 | 892 | ||
893 | 893 | func withdrawToUser (user,pool,posId,stopLoss) = { | |
894 | 894 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
895 | - | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)) | |
896 | 895 | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)), 0) | |
897 | 896 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0)) | |
898 | 897 | let poolTotalShare = getPoolTotalShare(pool) | |
906 | 905 | else throw(($getType(@) + " couldn't be cast to Int")) | |
907 | 906 | } | |
908 | 907 | else 0 | |
909 | - | let $ | |
910 | - | if (($ | |
908 | + | let $t02715627309 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset) | |
909 | + | if (($t02715627309 == $t02715627309)) | |
911 | 910 | then { | |
912 | - | let shareId = $ | |
913 | - | let cBalBAfter = $ | |
914 | - | let cBalAAfter = $ | |
915 | - | let assetIdB = $ | |
916 | - | let toUserAmountB = $ | |
917 | - | let assetIdA = $ | |
918 | - | let toUserAmountA = $ | |
911 | + | let shareId = $t02715627309._7 | |
912 | + | let cBalBAfter = $t02715627309._6 | |
913 | + | let cBalAAfter = $t02715627309._5 | |
914 | + | let assetIdB = $t02715627309._4 | |
915 | + | let toUserAmountB = $t02715627309._3 | |
916 | + | let assetIdA = $t02715627309._2 | |
917 | + | let toUserAmountA = $t02715627309._1 | |
919 | 918 | let closeDbtInv = if ((debt > 0)) | |
920 | 919 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
921 | 920 | else 0 | |
956 | 955 | let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
957 | 956 | let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
958 | 957 | let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB)) | |
959 | - | let $ | |
958 | + | let $t02899529092 = if ((borrowId == aId)) | |
960 | 959 | then $Tuple2(dPriceA, decPrA) | |
961 | 960 | else $Tuple2(dPriceB, decPrB) | |
962 | - | let borrowPrice = $ | |
963 | - | let borrowDecPr = $ | |
961 | + | let borrowPrice = $t02899529092._1 | |
962 | + | let borrowDecPr = $t02899529092._2 | |
964 | 963 | fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice) | |
965 | 964 | } | |
966 | 965 | ||
972 | 971 | then throw("Leverage can't be <100 and >300") | |
973 | 972 | else { | |
974 | 973 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
975 | - | let $ | |
976 | - | let AId = $ | |
977 | - | let BId = $ | |
978 | - | let balA = $ | |
979 | - | let balB = $ | |
980 | - | let shareId = $ | |
974 | + | let $t02951029600 = getPoolData(Address(fromBase58String(pool)), pType) | |
975 | + | let AId = $t02951029600._1 | |
976 | + | let BId = $t02951029600._2 | |
977 | + | let balA = $t02951029600._3 | |
978 | + | let balB = $t02951029600._4 | |
979 | + | let shareId = $t02951029600._5 | |
981 | 980 | let borrowAmount = if ((leverage > 100)) | |
982 | 981 | then calcBorrowAmount(pmtA, pmtB, AId, BId, leverage, borrowId) | |
983 | 982 | else 0 | |
984 | - | let $ | |
983 | + | let $t02973529842 = if ((borrowId == AId)) | |
985 | 984 | then $Tuple2((pmtA + borrowAmount), pmtB) | |
986 | 985 | else $Tuple2(pmtA, (pmtB + borrowAmount)) | |
987 | - | let payInA = $ | |
988 | - | let payInB = $ | |
989 | - | let $ | |
990 | - | let lpAmount = $ | |
991 | - | let loss = $ | |
986 | + | let payInA = $t02973529842._1 | |
987 | + | let payInB = $t02973529842._2 | |
988 | + | let $t02984529938 = calcReplenishLPVirt(pType, pool, payInA, AId, payInB, BId, balA, balB) | |
989 | + | let lpAmount = $t02984529938._1 | |
990 | + | let loss = $t02984529938._2 | |
992 | 991 | let impactMod = if ((0 > loss)) | |
993 | 992 | then (loss * -1) | |
994 | 993 | else loss | |
1018 | 1017 | @Callable(i) | |
1019 | 1018 | func getUserPositionInDollarsREADONLY (user,pools,posNum) = { | |
1020 | 1019 | func userPos (a,pool) = { | |
1021 | - | let $ | |
1022 | - | let totalPos = $ | |
1023 | - | let posDebt = $ | |
1024 | - | let index = $ | |
1020 | + | let $t03075130785 = a | |
1021 | + | let totalPos = $t03075130785._1 | |
1022 | + | let posDebt = $t03075130785._2 | |
1023 | + | let index = $t03075130785._3 | |
1025 | 1024 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1026 | - | let $ | |
1027 | - | let AId = $ | |
1028 | - | let BId = $ | |
1029 | - | let balA = $ | |
1030 | - | let balB = $ | |
1031 | - | let shareId = $ | |
1025 | + | let $t03087730967 = getPoolData(Address(fromBase58String(pool)), pType) | |
1026 | + | let AId = $t03087730967._1 | |
1027 | + | let BId = $t03087730967._2 | |
1028 | + | let balA = $t03087730967._3 | |
1029 | + | let balB = $t03087730967._4 | |
1030 | + | let shareId = $t03087730967._5 | |
1032 | 1031 | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0) | |
1033 | 1032 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0)) | |
1034 | 1033 | let sharePrices = getSharePrice(shareId) | |
1054 | 1053 | } | |
1055 | 1054 | } | |
1056 | 1055 | ||
1057 | - | let $ | |
1056 | + | let $t03201032065 = { | |
1058 | 1057 | let $l = pools | |
1059 | 1058 | let $s = size($l) | |
1060 | 1059 | let $acc0 = $Tuple3(nil, nil, 0) | |
1068 | 1067 | ||
1069 | 1068 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
1070 | 1069 | } | |
1071 | - | let pos = $ | |
1072 | - | let debt = $ | |
1070 | + | let pos = $t03201032065._1 | |
1071 | + | let debt = $t03201032065._2 | |
1073 | 1072 | $Tuple2(nil, $Tuple2(pos, debt)) | |
1074 | 1073 | } | |
1075 | 1074 | ||
1082 | 1081 | then throw("Leverage can't be <100 and >300") | |
1083 | 1082 | else { | |
1084 | 1083 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1085 | - | let $ | |
1086 | - | let AId = $ | |
1087 | - | let BId = $ | |
1088 | - | let balA = $ | |
1089 | - | let balB = $ | |
1090 | - | let shareId = $ | |
1091 | - | let $ | |
1084 | + | let $t03238832478 = getPoolData(Address(fromBase58String(pool)), pType) | |
1085 | + | let AId = $t03238832478._1 | |
1086 | + | let BId = $t03238832478._2 | |
1087 | + | let balA = $t03238832478._3 | |
1088 | + | let balB = $t03238832478._4 | |
1089 | + | let shareId = $t03238832478._5 | |
1090 | + | let $t03248133118 = if ((size(i.payments) == 2)) | |
1092 | 1091 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
1093 | 1092 | then throw("Wrong payment asset A") | |
1094 | 1093 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
1101 | 1100 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
1102 | 1101 | else throw("Wrong payment") | |
1103 | 1102 | else throw("One or two payments expected") | |
1104 | - | let pmtA = $ | |
1105 | - | let pmtAssetA = $ | |
1106 | - | let pmtB = $ | |
1107 | - | let pmtAssetB = $ | |
1103 | + | let pmtA = $t03248133118._1 | |
1104 | + | let pmtAssetA = $t03248133118._2 | |
1105 | + | let pmtB = $t03248133118._3 | |
1106 | + | let pmtAssetB = $t03248133118._4 | |
1108 | 1107 | let newPosNum = getNewUserPositionNumber(toString(i.caller)) | |
1109 | 1108 | if ((leverage > 100)) | |
1110 | 1109 | then { | |
1127 | 1126 | else throw("Strict value is not equal to itself.") | |
1128 | 1127 | } | |
1129 | 1128 | else { | |
1130 | - | let $ | |
1131 | - | let userStaked = $ | |
1132 | - | let axlyFee = $ | |
1129 | + | let $t03404634158 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1130 | + | let userStaked = $t03404634158._1 | |
1131 | + | let axlyFee = $t03404634158._2 | |
1133 | 1132 | (replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId)) | |
1134 | 1133 | } | |
1135 | 1134 | } | |
1175 | 1174 | ||
1176 | 1175 | @Callable(i) | |
1177 | 1176 | func replenishFromLand (requestId) = valueOrElse(isLandCall(i), { | |
1178 | - | let $ | |
1179 | - | let user = $ | |
1180 | - | let pool = $ | |
1181 | - | let pmtA = $ | |
1182 | - | let AId = $ | |
1183 | - | let pmtB = $ | |
1184 | - | let BId = $ | |
1185 | - | let balA = $ | |
1186 | - | let balB = $ | |
1187 | - | let shareId = $ | |
1188 | - | let bwAsset = $ | |
1189 | - | let bwAmount = $ | |
1177 | + | let $t03591136015 = parseRequest(requestId) | |
1178 | + | let user = $t03591136015._1 | |
1179 | + | let pool = $t03591136015._2 | |
1180 | + | let pmtA = $t03591136015._3 | |
1181 | + | let AId = $t03591136015._4 | |
1182 | + | let pmtB = $t03591136015._5 | |
1183 | + | let BId = $t03591136015._6 | |
1184 | + | let balA = $t03591136015._7 | |
1185 | + | let balB = $t03591136015._8 | |
1186 | + | let shareId = $t03591136015._9 | |
1187 | + | let bwAsset = $t03591136015._10 | |
1188 | + | let bwAmount = $t03591136015._11 | |
1190 | 1189 | if ((size(i.payments) != 1)) | |
1191 | 1190 | then throw("Wrong payment size") | |
1192 | 1191 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
1194 | 1193 | else (i.payments[0].amount != bwAmount)) | |
1195 | 1194 | then throw("Wrong payment") | |
1196 | 1195 | else { | |
1197 | - | let $ | |
1196 | + | let $t03620536329 = if ((AId == bwAsset)) | |
1198 | 1197 | then $Tuple2((pmtA + i.payments[0].amount), pmtB) | |
1199 | 1198 | else $Tuple2(pmtA, (pmtB + i.payments[0].amount)) | |
1200 | - | let pmtAllA = $ | |
1201 | - | let pmtAllB = $ | |
1199 | + | let pmtAllA = $t03620536329._1 | |
1200 | + | let pmtAllB = $t03620536329._2 | |
1202 | 1201 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
1203 | - | let $ | |
1204 | - | let userStaked = $ | |
1205 | - | let axlyFee = $ | |
1202 | + | let $t03641136526 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId) | |
1203 | + | let userStaked = $t03641136526._1 | |
1204 | + | let axlyFee = $t03641136526._2 | |
1206 | 1205 | let posNum = getNewUserPositionNumber(user) | |
1207 | 1206 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
1208 | 1207 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
1216 | 1215 | func liquidate (user,posId,liquidateAmount) = valueOrElse(isLandCall(i), { | |
1217 | 1216 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1218 | 1217 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1219 | - | let $ | |
1220 | - | let AId = $ | |
1221 | - | let BId = $ | |
1222 | - | let balA = $ | |
1223 | - | let balB = $ | |
1224 | - | let shareId = $ | |
1218 | + | let $t03730537395 = getPoolData(Address(fromBase58String(pool)), pType) | |
1219 | + | let AId = $t03730537395._1 | |
1220 | + | let BId = $t03730537395._2 | |
1221 | + | let balA = $t03730537395._3 | |
1222 | + | let balB = $t03730537395._4 | |
1223 | + | let shareId = $t03730537395._5 | |
1225 | 1224 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1226 | 1225 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1227 | 1226 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1248 | 1247 | ||
1249 | 1248 | @Callable(i) | |
1250 | 1249 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = valueOrElse(isAdminCall(i), { | |
1251 | - | let $ | |
1250 | + | let $t03918139375 = if (claim) | |
1252 | 1251 | then claimFarmed(type, pool) | |
1253 | 1252 | else { | |
1254 | 1253 | let claimedAsset = if ((type == SF_POOL)) | |
1256 | 1255 | else WXID | |
1257 | 1256 | $Tuple2(amountToExchange, claimedAsset) | |
1258 | 1257 | } | |
1259 | - | let claimedAmount = $ | |
1260 | - | let claimedAsset = $ | |
1258 | + | let claimedAmount = $t03918139375._1 | |
1259 | + | let claimedAsset = $t03918139375._2 | |
1261 | 1260 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
1262 | 1261 | let change = (claimedAmount - amountToExchange) | |
1263 | 1262 | let changeEntry = if ((change > 0)) | |
1270 | 1269 | ||
1271 | 1270 | @Callable(i) | |
1272 | 1271 | func capitalizeExPuzzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = valueOrElse(isAdminCall(i), { | |
1273 | - | let $ | |
1272 | + | let $t04006040254 = if (claim) | |
1274 | 1273 | then claimFarmed(type, pool) | |
1275 | 1274 | else { | |
1276 | 1275 | let claimedAsset = if ((type == SF_POOL)) | |
1278 | 1277 | else WXID | |
1279 | 1278 | $Tuple2(amountToExchange, claimedAsset) | |
1280 | 1279 | } | |
1281 | - | let claimedAmount = $ | |
1282 | - | let claimedAsset = $ | |
1280 | + | let claimedAmount = $t04006040254._1 | |
1281 | + | let claimedAsset = $t04006040254._2 | |
1283 | 1282 | let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
1284 | 1283 | let change = (claimedAmount - amountToExchange) | |
1285 | 1284 | let changeEntry = if ((change > 0)) | |
1292 | 1291 | ||
1293 | 1292 | @Callable(i) | |
1294 | 1293 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = valueOrElse(isAdminCall(i), { | |
1295 | - | let $ | |
1294 | + | let $t04100541199 = if (claim) | |
1296 | 1295 | then claimFarmed(type, pool) | |
1297 | 1296 | else { | |
1298 | 1297 | let claimedAsset = if ((type == SF_POOL)) | |
1300 | 1299 | else WXID | |
1301 | 1300 | $Tuple2(amountToExchange, claimedAsset) | |
1302 | 1301 | } | |
1303 | - | let claimedAmount = $ | |
1304 | - | let claimedAsset = $ | |
1302 | + | let claimedAmount = $t04100541199._1 | |
1303 | + | let claimedAsset = $t04100541199._2 | |
1305 | 1304 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
1306 | 1305 | let change = (claimedAmount - amountToExchange) | |
1307 | 1306 | let changeEntry = if ((change > 0)) | |
1318 | 1317 | else false) | |
1319 | 1318 | then throw("Wrong type") | |
1320 | 1319 | else { | |
1321 | - | let $ | |
1322 | - | let aId = $ | |
1323 | - | let bId = $ | |
1324 | - | let aBal = $ | |
1325 | - | let bBal = $ | |
1326 | - | let shareId = $ | |
1320 | + | let $t04192042014 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1321 | + | let aId = $t04192042014._1 | |
1322 | + | let bId = $t04192042014._2 | |
1323 | + | let aBal = $t04192042014._3 | |
1324 | + | let bBal = $t04192042014._4 | |
1325 | + | let shareId = $t04192042014._5 | |
1327 | 1326 | [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kAxlyStopLossNoLoanFee), stoplossFeeNoLoan), IntegerEntry((poolAddr + kAxlyStopLossLoanFee), stoplossFeeWithLoan), IntegerEntry((poolAddr + kPoolInterestLoan), 0), IntegerEntry((poolAddr + kPoolInterestNoLoan), 0), StringEntry((kPool + poolAddr), type), StringEntry((shareId + kSharePool), poolAddr)] | |
1328 | 1327 | }) | |
1329 | 1328 |
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_NO_LOAN = "capNoLoan" | |
9 | 9 | ||
10 | 10 | let CAP_FEE_LOAN = "capLoan" | |
11 | 11 | ||
12 | 12 | let STOPLOSS_FEE_NO_LOAN = "stopLossNoLoan" | |
13 | 13 | ||
14 | 14 | let STOPLOSS_LOAN = "stopLossLoan" | |
15 | 15 | ||
16 | 16 | let LOAN_FEE = "loan" | |
17 | 17 | ||
18 | 18 | let NO_LOAN_FEE = "noLoan" | |
19 | 19 | ||
20 | 20 | let NO_FEE = "noFee" | |
21 | 21 | ||
22 | 22 | let SCALE8 = 100000000 | |
23 | 23 | ||
24 | 24 | let SCALE10 = 10000000000 | |
25 | 25 | ||
26 | 26 | let SCALE16 = toBigInt(10000000000000000) | |
27 | 27 | ||
28 | 28 | let FEE_SCALE6 = 1000000 | |
29 | 29 | ||
30 | 30 | let kSFPoolAAssetBalance = "A_asset_balance" | |
31 | 31 | ||
32 | 32 | let kSFPoolBAssetBalance = "B_asset_balance" | |
33 | 33 | ||
34 | 34 | let kSFPoolAAssetId = "A_asset_id" | |
35 | 35 | ||
36 | 36 | let kSFPoolBAssetId = "B_asset_id" | |
37 | 37 | ||
38 | 38 | let kSFPoolShareId = "share_asset_id" | |
39 | 39 | ||
40 | 40 | let kSFPoolShareSupply = "share_asset_supply" | |
41 | 41 | ||
42 | 42 | let kSFPoolFee = "commission" | |
43 | 43 | ||
44 | 44 | let kUserPosition = "_user_position" | |
45 | 45 | ||
46 | 46 | let kUserPositionPool = "_user_position_pool" | |
47 | 47 | ||
48 | 48 | let kUserBorrowAmount = "_user_position_borrow_amount" | |
49 | 49 | ||
50 | 50 | let kUserBorrowAssetId = "_user_position_borrow_asset_id" | |
51 | 51 | ||
52 | 52 | let kUserPositionNum = "_user_position_number" | |
53 | 53 | ||
54 | 54 | let kUserPositionInterest = "_user_position_interest" | |
55 | 55 | ||
56 | 56 | let kPoolTotal = "_pool_total" | |
57 | 57 | ||
58 | 58 | let kPoolTotalLoan = "_pool_total_loan" | |
59 | 59 | ||
60 | 60 | let kPoolInterestLoan = "_pool_interest_loan" | |
61 | 61 | ||
62 | 62 | let kPoolInterestNoLoan = "_pool_interest_no_loan" | |
63 | 63 | ||
64 | 64 | let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan" | |
65 | 65 | ||
66 | 66 | let kAxlyInFeeWithLoan = "_axly_fee_with_loan" | |
67 | 67 | ||
68 | 68 | let kAxlyNoLoanCapFee = "_axly_fee_cap_with_loan" | |
69 | 69 | ||
70 | 70 | let kAxlyWithLoanCapFee = "_axly_fee_cap_no_loan" | |
71 | 71 | ||
72 | 72 | let kAxlyStopLossNoLoanFee = "_axly_fee_stoploss_with_loan" | |
73 | 73 | ||
74 | 74 | let kAxlyStopLossLoanFee = "_axly_fee_stoploss_no_loan" | |
75 | 75 | ||
76 | 76 | let kRequestId = "_request_id" | |
77 | 77 | ||
78 | 78 | let kRequestIter = "requests_iter" | |
79 | 79 | ||
80 | 80 | let kPool = "pool_" | |
81 | 81 | ||
82 | 82 | let kSharePool = "_pool_share_id" | |
83 | 83 | ||
84 | 84 | let kPoolCapChange = "_pool_cap_change" | |
85 | 85 | ||
86 | 86 | let kTokenLastPrice = "last_price" | |
87 | 87 | ||
88 | 88 | let kUserStopLoss = "_stop_loss" | |
89 | 89 | ||
90 | 90 | let kMoneyBox = "axly_money_box" | |
91 | 91 | ||
92 | 92 | let kSFFarmingAddr = "swopfi_farming_addr" | |
93 | 93 | ||
94 | 94 | let kLendService = "lend_service_addr" | |
95 | 95 | ||
96 | 96 | let kAdminCallPK = "admin_call_pub_key" | |
97 | 97 | ||
98 | 98 | let kPriceOracle = "price_oracle" | |
99 | 99 | ||
100 | 100 | let kExContract = "exchange_contract" | |
101 | 101 | ||
102 | 102 | let kWxSwapContract = "wx_swap_contract" | |
103 | 103 | ||
104 | 104 | let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address"))) | |
105 | 105 | ||
106 | 106 | let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address"))) | |
107 | 107 | ||
108 | 108 | let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address"))) | |
109 | 109 | ||
110 | 110 | let wxSwapContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kWxSwapContract), "No wx swap address"))) | |
111 | 111 | ||
112 | 112 | let SWOPID = base58'4W19ndijcc2CsQa9HGW2dfXKTVXhnneWWttxXrtjPmEp' | |
113 | 113 | ||
114 | 114 | let WXID = base58'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc' | |
115 | 115 | ||
116 | 116 | func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr"))) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func getAdminCallAddr () = addressFromPublicKey(fromBase58String(valueOrErrorMessage(getString(this, kAdminCallPK), "Can't get admin addr"))) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func isAdminCall (i) = if ((i.caller == getAdminCallAddr())) | |
123 | 123 | then unit | |
124 | 124 | else throw("Only admin can call this function") | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func isSelfCall (i) = if ((i.caller == this)) | |
128 | 128 | then unit | |
129 | 129 | else throw("Only contract itself can call this function") | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func isLandCall (i) = if ((i.caller == getLendSrvAddr())) | |
133 | 133 | then unit | |
134 | 134 | else throw("Only land contract can call this function") | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func accountBalance (assetId) = match assetId { | |
138 | 138 | case id: ByteVector => | |
139 | 139 | assetBalance(this, id) | |
140 | 140 | case waves: Unit => | |
141 | 141 | wavesBalance(this).available | |
142 | 142 | case _ => | |
143 | 143 | throw("Match error") | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | 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")) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func getWXPoolData (poolAddr) = { | |
151 | 151 | let cfg = { | |
152 | 152 | let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil) | |
153 | 153 | if ($isInstanceOf(@, "List[Any]")) | |
154 | 154 | then @ | |
155 | 155 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
156 | 156 | } | |
157 | 157 | if ((cfg == cfg)) | |
158 | 158 | then { | |
159 | 159 | let aId = valueOrErrorMessage({ | |
160 | 160 | let @ = cfg[4] | |
161 | 161 | if ($isInstanceOf(@, "String")) | |
162 | 162 | then @ | |
163 | 163 | else unit | |
164 | 164 | }, "Can't get pool A asset id") | |
165 | 165 | let bId = valueOrErrorMessage({ | |
166 | 166 | let @ = cfg[5] | |
167 | 167 | if ($isInstanceOf(@, "String")) | |
168 | 168 | then @ | |
169 | 169 | else unit | |
170 | 170 | }, "Can't get pool B asset id") | |
171 | 171 | let shareId = valueOrErrorMessage({ | |
172 | 172 | let @ = cfg[3] | |
173 | 173 | if ($isInstanceOf(@, "String")) | |
174 | 174 | then @ | |
175 | 175 | else unit | |
176 | 176 | }, "Can't get pool LP asset id") | |
177 | 177 | let balA = { | |
178 | 178 | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [aId], nil) | |
179 | 179 | if ($isInstanceOf(@, "Int")) | |
180 | 180 | then @ | |
181 | 181 | else throw(($getType(@) + " couldn't be cast to Int")) | |
182 | 182 | } | |
183 | 183 | if ((balA == balA)) | |
184 | 184 | then { | |
185 | 185 | let balB = { | |
186 | 186 | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [bId], nil) | |
187 | 187 | if ($isInstanceOf(@, "Int")) | |
188 | 188 | then @ | |
189 | 189 | else throw(($getType(@) + " couldn't be cast to Int")) | |
190 | 190 | } | |
191 | 191 | if ((balB == balB)) | |
192 | 192 | then $Tuple5(aId, bId, balA, balB, shareId) | |
193 | 193 | else throw("Strict value is not equal to itself.") | |
194 | 194 | } | |
195 | 195 | else throw("Strict value is not equal to itself.") | |
196 | 196 | } | |
197 | 197 | else throw("Strict value is not equal to itself.") | |
198 | 198 | } | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | func getPoolData (poolAddr,type) = if ((type == SF_POOL)) | |
202 | 202 | then getSFPoolData(poolAddr) | |
203 | 203 | else if ((type == WX_POOL)) | |
204 | 204 | then getWXPoolData(poolAddr) | |
205 | 205 | else throw("Wrong pool type") | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | func getShareSupply (poolAddr,type,shareId) = if ((type == SF_POOL)) | |
209 | 209 | then valueOrErrorMessage(getInteger(poolAddr, kSFPoolShareSupply), "Can't get share asset supply") | |
210 | 210 | else if ((type == WX_POOL)) | |
211 | 211 | then valueOrErrorMessage(assetInfo(fromBase58String(shareId)), "Wrong ShareId").quantity | |
212 | 212 | else throw("Wrong pool type") | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0) | |
216 | 216 | ||
217 | 217 | ||
218 | 218 | func getPoolTotalShareWithLoan (pool) = valueOrElse(getInteger(this, (pool + kPoolTotalLoan)), 0) | |
219 | 219 | ||
220 | 220 | ||
221 | 221 | func getNewUserPositionNumber (user) = (valueOrElse(getInteger(this, (user + kUserPositionNum)), 0) + 1) | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | func getAxlyFee (pool,feeType) = if ((feeType == CAP_FEE_LOAN)) | |
225 | 225 | then getIntegerValue(this, (pool + kAxlyWithLoanCapFee)) | |
226 | 226 | else if ((feeType == CAP_FEE_NO_LOAN)) | |
227 | 227 | then getIntegerValue(this, (pool + kAxlyNoLoanCapFee)) | |
228 | 228 | else if ((feeType == LOAN_FEE)) | |
229 | 229 | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
230 | 230 | else if ((feeType == NO_LOAN_FEE)) | |
231 | 231 | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
232 | 232 | else if ((feeType == NO_FEE)) | |
233 | 233 | then 0 | |
234 | 234 | else throw("Wrong fee type") | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
238 | 238 | ||
239 | 239 | ||
240 | 240 | func getWXFarmingAddr (poolAddr) = { | |
241 | 241 | let fContract = Address(fromBase58String(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
242 | 242 | let factroyCfg = split(valueOrErrorMessage(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
243 | 243 | Address(fromBase58String(factroyCfg[1])) | |
244 | 244 | } | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | func assetIdToStr (assetId) = match assetId { | |
248 | 248 | case id: ByteVector => | |
249 | 249 | toBase58String(id) | |
250 | 250 | case waves: Unit => | |
251 | 251 | "WAVES" | |
252 | 252 | case _ => | |
253 | 253 | throw("Not Asset id") | |
254 | 254 | } | |
255 | 255 | ||
256 | 256 | ||
257 | 257 | func assetIdFromStr (assetId) = if ((assetId == "WAVES")) | |
258 | 258 | then unit | |
259 | 259 | else fromBase58String(assetId) | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
263 | 263 | then 8 | |
264 | 264 | else match assetInfo(fromBase58String(assetId)) { | |
265 | 265 | case asset: Asset => | |
266 | 266 | asset.decimals | |
267 | 267 | case _ => | |
268 | 268 | throw("Can't find asset") | |
269 | 269 | } | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | func getAssetPrecition (assetId) = pow(10, 0, getAssetDecimals(assetId), 0, 0, DOWN) | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func getAssetsPrice (assetIds) = { | |
276 | 276 | func getPrices (a,assetId) = { | |
277 | 277 | let assetPrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil) | |
278 | 278 | if ($isInstanceOf(@, "(Int, Int)")) | |
279 | 279 | then @ | |
280 | 280 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
281 | 281 | (a :+ assetPrice) | |
282 | 282 | } | |
283 | 283 | ||
284 | 284 | let $l = assetIds | |
285 | 285 | let $s = size($l) | |
286 | 286 | let $acc0 = nil | |
287 | 287 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
288 | 288 | then $a | |
289 | 289 | else getPrices($a, $l[$i]) | |
290 | 290 | ||
291 | 291 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
292 | 292 | then $a | |
293 | 293 | else throw("List size exceeds 50") | |
294 | 294 | ||
295 | 295 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
296 | 296 | } | |
297 | 297 | ||
298 | 298 | ||
299 | 299 | func getSharePrice (shareId) = { | |
300 | 300 | let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id") | |
301 | 301 | let poolAddr = Address(fromBase58String(pool)) | |
302 | 302 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
303 | 303 | let $t088698934 = getPoolData(poolAddr, pType) | |
304 | 304 | let aId = $t088698934._1 | |
305 | 305 | let bId = $t088698934._2 | |
306 | 306 | let aBalance = $t088698934._3 | |
307 | 307 | let bBalance = $t088698934._4 | |
308 | 308 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [aId, false], nil) | |
309 | 309 | if ($isInstanceOf(@, "(Int, Int)")) | |
310 | 310 | then @ | |
311 | 311 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
312 | 312 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [bId, false], nil) | |
313 | 313 | if ($isInstanceOf(@, "(Int, Int)")) | |
314 | 314 | then @ | |
315 | 315 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
316 | 316 | let shareSupply = getShareSupply(poolAddr, pType, shareId) | |
317 | 317 | let APrecision = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
318 | 318 | let BPrecision = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
319 | 319 | let sharePrecision = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN) | |
320 | 320 | let sum = (fraction(aBalance, dPriceA, APrecision) + fraction(bBalance, dPriceB, BPrecision)) | |
321 | 321 | fraction(sum, sharePrecision, shareSupply) | |
322 | 322 | } | |
323 | 323 | ||
324 | 324 | ||
325 | 325 | func getSharePrices (shareIds) = { | |
326 | 326 | func getPrices (a,shareId) = (a :+ getSharePrice(shareId)) | |
327 | 327 | ||
328 | 328 | let $l = shareIds | |
329 | 329 | let $s = size($l) | |
330 | 330 | let $acc0 = nil | |
331 | 331 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
332 | 332 | then $a | |
333 | 333 | else getPrices($a, $l[$i]) | |
334 | 334 | ||
335 | 335 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
336 | 336 | then $a | |
337 | 337 | else throw("List size exceeds 20") | |
338 | 338 | ||
339 | 339 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
340 | 340 | } | |
341 | 341 | ||
342 | 342 | ||
343 | 343 | func getCursEntries (aId,bId,shareId) = { | |
344 | 344 | let assetsPrices = getAssetsPrice([aId, bId]) | |
345 | 345 | let sharePrice = getSharePrice(shareId) | |
346 | 346 | let prices = [toString(assetsPrices[0]), toString(assetsPrices[1]), toString(sharePrice)] | |
347 | 347 | [StringEntry(kTokenLastPrice, makeString(prices, ","))] | |
348 | 348 | } | |
349 | 349 | ||
350 | 350 | ||
351 | 351 | func calcReplenishByTwoTokens (pType,poolAddr,pmtA,aId,pmtB,bId,balA,balB) = if ((pType == SF_POOL)) | |
352 | 352 | then { | |
353 | 353 | let repl = { | |
354 | 354 | let @ = invoke(poolAddr, "callFunction", ["calcLPReplenishTwoTokensREADONLY", [toString(pmtA), toString(pmtB)]], nil) | |
355 | 355 | if ($isInstanceOf(@, "List[Any]")) | |
356 | 356 | then @ | |
357 | 357 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
358 | 358 | } | |
359 | 359 | if ((repl == repl)) | |
360 | 360 | then $Tuple5({ | |
361 | 361 | let @ = repl[3] | |
362 | 362 | if ($isInstanceOf(@, "Int")) | |
363 | 363 | then @ | |
364 | 364 | else throw(($getType(@) + " couldn't be cast to Int")) | |
365 | 365 | }, { | |
366 | 366 | let @ = repl[4] | |
367 | 367 | if ($isInstanceOf(@, "Int")) | |
368 | 368 | then @ | |
369 | 369 | else throw(($getType(@) + " couldn't be cast to Int")) | |
370 | 370 | }, { | |
371 | 371 | let @ = repl[1] | |
372 | 372 | if ($isInstanceOf(@, "Int")) | |
373 | 373 | then @ | |
374 | 374 | else throw(($getType(@) + " couldn't be cast to Int")) | |
375 | 375 | }, assetIdToStr(repl[2]), { | |
376 | 376 | let @ = repl[0] | |
377 | 377 | if ($isInstanceOf(@, "Int")) | |
378 | 378 | then @ | |
379 | 379 | else throw(($getType(@) + " couldn't be cast to Int")) | |
380 | 380 | }) | |
381 | 381 | else throw("Strict value is not equal to itself.") | |
382 | 382 | } | |
383 | 383 | else { | |
384 | 384 | let $t01046410714 = $Tuple2(split({ | |
385 | 385 | let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil) | |
386 | 386 | if ($isInstanceOf(@, "String")) | |
387 | 387 | then @ | |
388 | 388 | else throw(($getType(@) + " couldn't be cast to String")) | |
389 | 389 | }, "__"), split({ | |
390 | 390 | let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil) | |
391 | 391 | if ($isInstanceOf(@, "String")) | |
392 | 392 | then @ | |
393 | 393 | else throw(($getType(@) + " couldn't be cast to String")) | |
394 | 394 | }, "__")) | |
395 | 395 | if (($t01046410714 == $t01046410714)) | |
396 | 396 | then { | |
397 | 397 | let evalPutInB = $t01046410714._2 | |
398 | 398 | let evalPutInA = $t01046410714._1 | |
399 | 399 | let lpInA = parseIntValue(evalPutInA[1]) | |
400 | 400 | let lpInB = parseIntValue(evalPutInB[1]) | |
401 | 401 | if ((lpInB > lpInA)) | |
402 | 402 | then { | |
403 | 403 | let pmt = parseIntValue(evalPutInA[8]) | |
404 | 404 | $Tuple5(pmtA, pmt, (pmtB - pmt), bId, lpInB) | |
405 | 405 | } | |
406 | 406 | else { | |
407 | 407 | let pmt = parseIntValue(evalPutInA[8]) | |
408 | 408 | $Tuple5(pmt, pmtB, (pmtA - pmt), aId, lpInA) | |
409 | 409 | } | |
410 | 410 | } | |
411 | 411 | else throw("Strict value is not equal to itself.") | |
412 | 412 | } | |
413 | 413 | ||
414 | 414 | ||
415 | 415 | func replenishTwoTokensByType (poolAddr,pType,pmtA,aId,pmtB,bId) = { | |
416 | 416 | let payments = [AttachedPayment(assetIdFromStr(aId), pmtA), AttachedPayment(assetIdFromStr(bId), pmtB)] | |
417 | 417 | if ((pType == SF_POOL)) | |
418 | 418 | then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
419 | 419 | else invoke(poolAddr, "put", [1000000, false], payments) | |
420 | 420 | } | |
421 | 421 | ||
422 | 422 | ||
423 | 423 | func replenishOneTokenByType (poolAddr,pType,pmt,pmtId) = { | |
424 | 424 | let payments = [AttachedPayment(assetIdFromStr(pmtId), pmt)] | |
425 | 425 | if ((pType == SF_POOL)) | |
426 | 426 | then invoke(poolAddr, "callFunction", ["replenishWithOneToken", ["0", "false", "0"]], payments) | |
427 | 427 | else invoke(poolAddr, "putOneTkn", [0, false], payments) | |
428 | 428 | } | |
429 | 429 | ||
430 | 430 | ||
431 | 431 | func stakeLP (pool,pType,shareId,amount) = { | |
432 | 432 | let payments = [AttachedPayment(fromBase58String(shareId), amount)] | |
433 | 433 | if ((pType == SF_POOL)) | |
434 | 434 | then invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], payments) | |
435 | 435 | else invoke(getWXFarmingAddr(addressFromStringValue(pool)), "stake", nil, payments) | |
436 | 436 | } | |
437 | 437 | ||
438 | 438 | ||
439 | 439 | func unstakeLP (pool,pType,shareId,amount) = { | |
440 | 440 | let $t01219912556 = if ((pType == SF_POOL)) | |
441 | 441 | then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount]) | |
442 | 442 | else if ((pType == WX_POOL)) | |
443 | 443 | then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount]) | |
444 | 444 | else throw("Wrong pool type") | |
445 | 445 | let farmAddr = $t01219912556._1 | |
446 | 446 | let fName = $t01219912556._2 | |
447 | 447 | let params = $t01219912556._3 | |
448 | 448 | let inv = invoke(farmAddr, fName, params, nil) | |
449 | 449 | if ((inv == inv)) | |
450 | 450 | then amount | |
451 | 451 | else throw("Strict value is not equal to itself.") | |
452 | 452 | } | |
453 | 453 | ||
454 | 454 | ||
455 | 455 | func calcAmountToPaySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
456 | 456 | let poolAddr = Address(fromBase58String(pool)) | |
457 | 457 | let feeScale6 = 1000000 | |
458 | 458 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
459 | 459 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee)) | |
460 | 460 | let $t01296913257 = if ((assetTokenToGet == assetIdA)) | |
461 | 461 | then { | |
462 | - | let amountToPay = fraction( | |
462 | + | let amountToPay = fraction(amntGetNoFee, balB, (balA - amntGetNoFee)) | |
463 | 463 | $Tuple2(amountToPay, assetIdB) | |
464 | 464 | } | |
465 | 465 | else { | |
466 | - | let amountToPay = fraction( | |
466 | + | let amountToPay = fraction(amntGetNoFee, balA, (balB - amntGetNoFee)) | |
467 | 467 | $Tuple2(amountToPay, assetIdA) | |
468 | 468 | } | |
469 | 469 | let amountToPay = $t01296913257._1 | |
470 | 470 | let assetToPay = $t01296913257._2 | |
471 | 471 | $Tuple2(assetToPay, amountToPay) | |
472 | 472 | } | |
473 | 473 | ||
474 | 474 | ||
475 | 475 | func calcAmountToPayWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
476 | 476 | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
477 | 477 | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
478 | 478 | let feeScale = toBigInt(100000000) | |
479 | - | let $ | |
479 | + | let $t01359613903 = if ((assetTokenToGet == assetIdA)) | |
480 | 480 | then { | |
481 | - | let amountToPay = fraction( | |
481 | + | let amountToPay = fraction(amountTokenToGet, balB, (balA - amountTokenToGet)) | |
482 | 482 | $Tuple2(amountToPay, assetIdB) | |
483 | 483 | } | |
484 | 484 | else { | |
485 | - | let amountToPay = fraction( | |
485 | + | let amountToPay = fraction(amountTokenToGet, balA, (balB - amountTokenToGet)) | |
486 | 486 | $Tuple2(amountToPay, assetIdA) | |
487 | 487 | } | |
488 | - | let amountToPay = $ | |
489 | - | let assetToPay = $ | |
488 | + | let amountToPay = $t01359613903._1 | |
489 | + | let assetToPay = $t01359613903._2 | |
490 | 490 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))))) | |
491 | 491 | $Tuple2(assetToPay, amountToPayWithFee) | |
492 | 492 | } | |
493 | 493 | ||
494 | 494 | ||
495 | 495 | func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL)) | |
496 | 496 | then { | |
497 | - | let $ | |
498 | - | let assetToPay = $ | |
499 | - | let amountToPay = $ | |
497 | + | let $t01424114363 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
498 | + | let assetToPay = $t01424114363._1 | |
499 | + | let amountToPay = $t01424114363._2 | |
500 | 500 | invoke(addressFromStringValue(pool), "callFunction", ["exchange", ["1"]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
501 | 501 | } | |
502 | 502 | else { | |
503 | - | let $ | |
504 | - | let assetToPay = $ | |
505 | - | let amountToPay = $ | |
503 | + | let $t01451414636 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
504 | + | let assetToPay = $t01451414636._1 | |
505 | + | let amountToPay = $t01451414636._2 | |
506 | 506 | invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
507 | 507 | } | |
508 | 508 | ||
509 | 509 | ||
510 | 510 | func calcReplenishLPVirt (pType,pool,pmtA,aId,pmtB,bId,balA,balB) = { | |
511 | 511 | let poolAddr = addressFromStringValue(pool) | |
512 | 512 | if ((pType == SF_POOL)) | |
513 | 513 | then { | |
514 | 514 | let inv = { | |
515 | 515 | let @ = invoke(poolAddr, "callFunction", ["calcLPReplenishDiffPropREADONLY", [toString(pmtA), toString(pmtB), "0"]], nil) | |
516 | 516 | if ($isInstanceOf(@, "List[Any]")) | |
517 | 517 | then @ | |
518 | 518 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
519 | 519 | } | |
520 | 520 | if ((inv == inv)) | |
521 | 521 | then $Tuple2({ | |
522 | 522 | let @ = inv[0] | |
523 | 523 | if ($isInstanceOf(@, "Int")) | |
524 | 524 | then @ | |
525 | 525 | else throw(($getType(@) + " couldn't be cast to Int")) | |
526 | 526 | }, { | |
527 | 527 | let @ = inv[1] | |
528 | 528 | if ($isInstanceOf(@, "Int")) | |
529 | 529 | then @ | |
530 | 530 | else throw(($getType(@) + " couldn't be cast to Int")) | |
531 | 531 | }) | |
532 | 532 | else throw("Strict value is not equal to itself.") | |
533 | 533 | } | |
534 | 534 | else if ((pType == WX_POOL)) | |
535 | 535 | then { | |
536 | - | let $ | |
536 | + | let $t01522415565 = if (if ((pmtA > 0)) | |
537 | 537 | then (pmtB > 0) | |
538 | 538 | else false) | |
539 | 539 | then { | |
540 | - | let $ | |
541 | - | let pmtInA = $ | |
542 | - | let pmtInB = $ | |
543 | - | let change = $ | |
544 | - | let changeId = $ | |
545 | - | let lpAmount = $ | |
540 | + | let $t01530515431 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
541 | + | let pmtInA = $t01530515431._1 | |
542 | + | let pmtInB = $t01530515431._2 | |
543 | + | let change = $t01530515431._3 | |
544 | + | let changeId = $t01530515431._4 | |
545 | + | let lpAmount = $t01530515431._5 | |
546 | 546 | $Tuple3(change, changeId, lpAmount) | |
547 | 547 | } | |
548 | 548 | else if ((pmtA > 0)) | |
549 | 549 | then $Tuple3(pmtA, aId, 0) | |
550 | 550 | else $Tuple3(pmtB, bId, 0) | |
551 | - | let change = $ | |
552 | - | let changeId = $ | |
553 | - | let lpTwo = $ | |
554 | - | let $ | |
551 | + | let change = $t01522415565._1 | |
552 | + | let changeId = $t01522415565._2 | |
553 | + | let lpTwo = $t01522415565._3 | |
554 | + | let $t01557215788 = if ((change > 0)) | |
555 | 555 | then { | |
556 | 556 | let inv = { | |
557 | 557 | let @ = invoke(poolAddr, "putOneTknREADONLY", [changeId, change], nil) | |
558 | 558 | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
559 | 559 | then @ | |
560 | 560 | else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)")) | |
561 | 561 | } | |
562 | 562 | if ((inv == inv)) | |
563 | 563 | then $Tuple2(inv._1, inv._3) | |
564 | 564 | else throw("Strict value is not equal to itself.") | |
565 | 565 | } | |
566 | 566 | else $Tuple2(0, 0) | |
567 | - | let lpOne = $ | |
568 | - | let loss = $ | |
567 | + | let lpOne = $t01557215788._1 | |
568 | + | let loss = $t01557215788._2 | |
569 | 569 | $Tuple2((lpTwo + lpOne), loss) | |
570 | 570 | } | |
571 | 571 | else throw("Wrong pool type") | |
572 | 572 | } | |
573 | 573 | ||
574 | 574 | ||
575 | 575 | func calcWithdrawLPVirt (pType,pool,lpAmount,shareId,aId,bId,balA,balB,borrowAmount,borrowAssetId) = { | |
576 | 576 | let poolAddr = addressFromStringValue(pool) | |
577 | - | let $ | |
577 | + | let $t01608216582 = if ((pType == SF_POOL)) | |
578 | 578 | then { | |
579 | 579 | let inv = { | |
580 | 580 | let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(lpAmount), toString(balA), toString(balB)]], nil) | |
581 | 581 | if ($isInstanceOf(@, "List[Any]")) | |
582 | 582 | then @ | |
583 | 583 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
584 | 584 | } | |
585 | 585 | if ((inv == inv)) | |
586 | 586 | then $Tuple2({ | |
587 | 587 | let @ = inv[0] | |
588 | 588 | if ($isInstanceOf(@, "Int")) | |
589 | 589 | then @ | |
590 | 590 | else throw(($getType(@) + " couldn't be cast to Int")) | |
591 | 591 | }, { | |
592 | 592 | let @ = inv[1] | |
593 | 593 | if ($isInstanceOf(@, "Int")) | |
594 | 594 | then @ | |
595 | 595 | else throw(($getType(@) + " couldn't be cast to Int")) | |
596 | 596 | }) | |
597 | 597 | else throw("Strict value is not equal to itself.") | |
598 | 598 | } | |
599 | 599 | else if ((pType == WX_POOL)) | |
600 | 600 | then { | |
601 | 601 | let get = split({ | |
602 | 602 | let @ = invoke(poolAddr, "evaluateGetREADONLY", [shareId, lpAmount], nil) | |
603 | 603 | if ($isInstanceOf(@, "String")) | |
604 | 604 | then @ | |
605 | 605 | else throw(($getType(@) + " couldn't be cast to String")) | |
606 | 606 | }, "__") | |
607 | 607 | if ((get == get)) | |
608 | 608 | then $Tuple2(parseIntValue(get[1]), parseIntValue(get[2])) | |
609 | 609 | else throw("Strict value is not equal to itself.") | |
610 | 610 | } | |
611 | 611 | else throw("Wrong pool type") | |
612 | - | let getAmountA = $ | |
613 | - | let getAmountB = $ | |
612 | + | let getAmountA = $t01608216582._1 | |
613 | + | let getAmountB = $t01608216582._2 | |
614 | 614 | if ((borrowAmount > 0)) | |
615 | 615 | then { | |
616 | 616 | let amountToGetEx = if (if ((borrowAssetId == aId)) | |
617 | 617 | then (borrowAmount > getAmountA) | |
618 | 618 | else false) | |
619 | 619 | then (borrowAmount - getAmountA) | |
620 | 620 | else if (if ((borrowAssetId == bId)) | |
621 | 621 | then (borrowAmount > getAmountB) | |
622 | 622 | else false) | |
623 | 623 | then (borrowAmount - getAmountB) | |
624 | 624 | else 0 | |
625 | - | let $ | |
625 | + | let $t01686017163 = if ((amountToGetEx > 0)) | |
626 | 626 | then if ((pType == SF_POOL)) | |
627 | 627 | then calcAmountToPaySF(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId) | |
628 | 628 | else calcAmountToPayWX(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId) | |
629 | 629 | else $Tuple2("", 0) | |
630 | - | let assetToPay = $ | |
631 | - | let amountToPay = $ | |
630 | + | let assetToPay = $t01686017163._1 | |
631 | + | let amountToPay = $t01686017163._2 | |
632 | 632 | if ((borrowAssetId == aId)) | |
633 | 633 | then $Tuple2(((getAmountA + amountToGetEx) - borrowAmount), (getAmountB - amountToPay)) | |
634 | 634 | else $Tuple2((getAmountA - amountToPay), ((getAmountB + amountToGetEx) - borrowAmount)) | |
635 | 635 | } | |
636 | 636 | else $Tuple2(getAmountA, getAmountB) | |
637 | 637 | } | |
638 | 638 | ||
639 | 639 | ||
640 | 640 | func claimFarmed (type,pool) = if ((type == SF_POOL)) | |
641 | 641 | then { | |
642 | 642 | let balBefore = accountBalance(SWOPID) | |
643 | 643 | if ((balBefore == balBefore)) | |
644 | 644 | then { | |
645 | 645 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
646 | 646 | if ((inv == inv)) | |
647 | 647 | then { | |
648 | 648 | let balAfter = accountBalance(SWOPID) | |
649 | 649 | $Tuple2((balAfter - balBefore), SWOPID) | |
650 | 650 | } | |
651 | 651 | else throw("Strict value is not equal to itself.") | |
652 | 652 | } | |
653 | 653 | else throw("Strict value is not equal to itself.") | |
654 | 654 | } | |
655 | 655 | else if ((type == WX_POOL)) | |
656 | 656 | then { | |
657 | 657 | let balBefore = accountBalance(WXID) | |
658 | 658 | if ((balBefore == balBefore)) | |
659 | 659 | then { | |
660 | 660 | let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil) | |
661 | 661 | if ((inv == inv)) | |
662 | 662 | then { | |
663 | 663 | let balAfter = accountBalance(WXID) | |
664 | 664 | $Tuple2((balAfter - balBefore), WXID) | |
665 | 665 | } | |
666 | 666 | else throw("Strict value is not equal to itself.") | |
667 | 667 | } | |
668 | 668 | else throw("Strict value is not equal to itself.") | |
669 | 669 | } | |
670 | 670 | else throw("Wrong pool type") | |
671 | 671 | ||
672 | 672 | ||
673 | 673 | func replenishByType (pType,pool,feeType,pmtA,aId,pmtB,bId,balA,balB,LPId) = { | |
674 | 674 | let lpBalanceBefore = accountBalance(fromBase58String(LPId)) | |
675 | 675 | if ((lpBalanceBefore == lpBalanceBefore)) | |
676 | 676 | then { | |
677 | 677 | let poolAddr = addressFromStringValue(pool) | |
678 | - | let $ | |
678 | + | let $t01836018776 = if (if ((pmtA > 0)) | |
679 | 679 | then (pmtB > 0) | |
680 | 680 | else false) | |
681 | 681 | then { | |
682 | - | let $ | |
683 | - | let pmtInA = $ | |
684 | - | let pmtInB = $ | |
685 | - | let change = $ | |
686 | - | let changeId = $ | |
682 | + | let $t01842618542 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
683 | + | let pmtInA = $t01842618542._1 | |
684 | + | let pmtInB = $t01842618542._2 | |
685 | + | let change = $t01842618542._3 | |
686 | + | let changeId = $t01842618542._4 | |
687 | 687 | let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId) | |
688 | 688 | if ((inv == inv)) | |
689 | 689 | then $Tuple2(change, changeId) | |
690 | 690 | else throw("Strict value is not equal to itself.") | |
691 | 691 | } | |
692 | 692 | else if ((pmtA > 0)) | |
693 | 693 | then $Tuple2(pmtA, aId) | |
694 | 694 | else if ((pmtB > 0)) | |
695 | 695 | then $Tuple2(pmtB, bId) | |
696 | 696 | else throw("pmts must be > 0") | |
697 | - | let change = $ | |
698 | - | let changeId = $ | |
697 | + | let change = $t01836018776._1 | |
698 | + | let changeId = $t01836018776._2 | |
699 | 699 | let inv = if ((change > 0)) | |
700 | 700 | then replenishOneTokenByType(poolAddr, pType, change, changeId) | |
701 | 701 | else nil | |
702 | 702 | if ((inv == inv)) | |
703 | 703 | then { | |
704 | 704 | let lpBalanceAfter = accountBalance(fromBase58String(LPId)) | |
705 | 705 | let totalStaked = (lpBalanceAfter - lpBalanceBefore) | |
706 | 706 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
707 | 707 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
708 | 708 | if ((0 >= userShareForStake)) | |
709 | 709 | then throw("amount of staked sharetokens must be > 0") | |
710 | 710 | else { | |
711 | 711 | let invLP = stakeLP(pool, pType, LPId, userShareForStake) | |
712 | 712 | if ((invLP == invLP)) | |
713 | 713 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
714 | 714 | else throw("Strict value is not equal to itself.") | |
715 | 715 | } | |
716 | 716 | } | |
717 | 717 | else throw("Strict value is not equal to itself.") | |
718 | 718 | } | |
719 | 719 | else throw("Strict value is not equal to itself.") | |
720 | 720 | } | |
721 | 721 | ||
722 | 722 | ||
723 | 723 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = { | |
724 | 724 | let totalAmount = getPoolTotalShare(pool) | |
725 | 725 | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
726 | - | let $ | |
726 | + | let $t01963419872 = if (withLoan) | |
727 | 727 | then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount)) | |
728 | 728 | else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan) | |
729 | - | let curPoolInterest = $ | |
730 | - | let totalStakedWithLoan = $ | |
729 | + | let curPoolInterest = $t01963419872._1 | |
730 | + | let totalStakedWithLoan = $t01963419872._2 | |
731 | 731 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), totalStakedWithLoan), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), StringEntry((((user + "_") + toString(posNum)) + kUserPositionPool), pool), IntegerEntry((user + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
732 | 732 | } | |
733 | 733 | ||
734 | 734 | ||
735 | 735 | func exchangeKeeper (toToken,pmtAmount,pmtAsset,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
736 | 736 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
737 | 737 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
738 | 738 | then { | |
739 | 739 | let inv = invoke(exContract, "swap", [amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
740 | 740 | if ((inv == inv)) | |
741 | 741 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
742 | 742 | else throw("Strict value is not equal to itself.") | |
743 | 743 | } | |
744 | 744 | else throw("Strict value is not equal to itself.") | |
745 | 745 | } | |
746 | 746 | ||
747 | 747 | ||
748 | 748 | func exchangePuzzle (toToken,pmtAmount,pmtAsset,routesStr,minToReceive,options) = { | |
749 | 749 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
750 | 750 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
751 | 751 | then { | |
752 | 752 | let inv = invoke(exContract, "puzzleSwap", [routesStr, minToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
753 | 753 | if ((inv == inv)) | |
754 | 754 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
755 | 755 | else throw("Strict value is not equal to itself.") | |
756 | 756 | } | |
757 | 757 | else throw("Strict value is not equal to itself.") | |
758 | 758 | } | |
759 | 759 | ||
760 | 760 | ||
761 | 761 | func exchangeSwopFi (toToken,pmtAmount,pmtAsset,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
762 | 762 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
763 | 763 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
764 | 764 | then { | |
765 | 765 | let inv = invoke(exContract, "swopfiSwap", [exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
766 | 766 | if ((inv == inv)) | |
767 | 767 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
768 | 768 | else throw("Strict value is not equal to itself.") | |
769 | 769 | } | |
770 | 770 | else throw("Strict value is not equal to itself.") | |
771 | 771 | } | |
772 | 772 | ||
773 | 773 | ||
774 | 774 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
775 | 775 | let poolAddr = Address(fromBase58String(pool)) | |
776 | - | let $ | |
777 | - | let AId = $ | |
778 | - | let BId = $ | |
779 | - | let balA = $ | |
780 | - | let balB = $ | |
781 | - | let shareId = $ | |
776 | + | let $t02222322289 = getPoolData(poolAddr, pType) | |
777 | + | let AId = $t02222322289._1 | |
778 | + | let BId = $t02222322289._2 | |
779 | + | let balA = $t02222322289._3 | |
780 | + | let balB = $t02222322289._4 | |
781 | + | let shareId = $t02222322289._5 | |
782 | 782 | if (if ((tokenId != AId)) | |
783 | 783 | then (tokenId != BId) | |
784 | 784 | else false) | |
785 | 785 | then throw("Wrong asset") | |
786 | 786 | else { | |
787 | - | let $ | |
787 | + | let $t02237422454 = if ((tokenId == AId)) | |
788 | 788 | then $Tuple2(tokenAmount, 0) | |
789 | 789 | else $Tuple2(0, tokenAmount) | |
790 | - | let pmtA = $ | |
791 | - | let pmtB = $ | |
792 | - | let $ | |
793 | - | let stakedAmount = $ | |
794 | - | let nf = $ | |
790 | + | let pmtA = $t02237422454._1 | |
791 | + | let pmtB = $t02237422454._2 | |
792 | + | let $t02245722561 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
793 | + | let stakedAmount = $t02245722561._1 | |
794 | + | let nf = $t02245722561._2 | |
795 | 795 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
796 | 796 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
797 | 797 | let totalShareAmount = getPoolTotalShare(pool) | |
798 | 798 | let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool) | |
799 | 799 | let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount) | |
800 | 800 | let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8) | |
801 | 801 | let stakedNoLoan = (stakedAmount - stakedLoan) | |
802 | 802 | let newInterestLoan = if ((totalShareAmountWithLoan > 0)) | |
803 | 803 | then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan)) | |
804 | 804 | else 0 | |
805 | 805 | let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0)) | |
806 | 806 | then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan))) | |
807 | 807 | else 0 | |
808 | 808 | let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
809 | 809 | let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
810 | 810 | let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan)) | |
811 | 811 | if ((axlyFee == axlyFee)) | |
812 | 812 | then ([IntegerEntry((pool + kPoolInterestLoan), newInterestLoan), IntegerEntry((pool + kPoolInterestNoLoan), newInterestNoLoan), IntegerEntry((pool + kPoolTotal), ((totalShareAmount + stakedAmount) - axlyFee)), IntegerEntry((pool + kPoolTotalLoan), ((totalShareAmountWithLoan + stakedLoan) - axlyFeeLoan)), ScriptTransfer(moneyBox, (axlyFeeLoan + axlyFeeNoLoan), fromBase58String(shareId))] ++ getCursEntries(AId, BId, shareId)) | |
813 | 813 | else throw("Strict value is not equal to itself.") | |
814 | 814 | } | |
815 | 815 | } | |
816 | 816 | ||
817 | 817 | ||
818 | 818 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = { | |
819 | 819 | let poolAddr = Address(fromBase58String(pool)) | |
820 | 820 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
821 | - | let $ | |
822 | - | let assetIdA = $ | |
823 | - | let assetIdB = $ | |
824 | - | let balA = $ | |
825 | - | let balB = $ | |
826 | - | let shareId = $ | |
821 | + | let $t02432924405 = getPoolData(poolAddr, pType) | |
822 | + | let assetIdA = $t02432924405._1 | |
823 | + | let assetIdB = $t02432924405._2 | |
824 | + | let balA = $t02432924405._3 | |
825 | + | let balB = $t02432924405._4 | |
826 | + | let shareId = $t02432924405._5 | |
827 | 827 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
828 | 828 | if ((cBalABefore == cBalABefore)) | |
829 | 829 | then { | |
830 | 830 | let cBalBBefore = accountBalance(assetIdFromStr(assetIdB)) | |
831 | 831 | if ((cBalBBefore == cBalBBefore)) | |
832 | 832 | then { | |
833 | 833 | let inv = if ((pType == SF_POOL)) | |
834 | 834 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
835 | 835 | else { | |
836 | 836 | let inv = unstakeLP(pool, pType, shareId, userCanWithdraw) | |
837 | 837 | if ((inv == inv)) | |
838 | 838 | then invoke(poolAddr, "get", nil, [AttachedPayment(assetIdFromStr(shareId), userCanWithdraw)]) | |
839 | 839 | else throw("Strict value is not equal to itself.") | |
840 | 840 | } | |
841 | 841 | if ((inv == inv)) | |
842 | 842 | then { | |
843 | 843 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
844 | 844 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
845 | - | let $ | |
846 | - | let tokensAmountA = $ | |
847 | - | let tokensAmountB = $ | |
848 | - | let $ | |
845 | + | let $t02496825057 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
846 | + | let tokensAmountA = $t02496825057._1 | |
847 | + | let tokensAmountB = $t02496825057._2 | |
848 | + | let $t02506025756 = if ((debt > 0)) | |
849 | 849 | then { | |
850 | 850 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
851 | 851 | then (debt > tokensAmountA) | |
852 | 852 | else false) | |
853 | 853 | then (debt - tokensAmountA) | |
854 | 854 | else if (if ((borrowAsset == assetIdB)) | |
855 | 855 | then (debt > tokensAmountB) | |
856 | 856 | else false) | |
857 | 857 | then (debt - tokensAmountB) | |
858 | 858 | else 0 | |
859 | 859 | let exInv = if ((amountToGetEx > 0)) | |
860 | 860 | then exchangeDirectly(pType, pool, assetIdA, assetIdB, balA, balB, amountToGetEx, borrowAsset) | |
861 | 861 | else 0 | |
862 | 862 | if ((exInv == exInv)) | |
863 | 863 | then { | |
864 | 864 | let cBalAAfterRepay = accountBalance(assetIdFromStr(assetIdA)) | |
865 | 865 | let cBalBAfterRepay = accountBalance(assetIdFromStr(assetIdB)) | |
866 | 866 | $Tuple2((cBalAAfterRepay - cBalABefore), (cBalBAfterRepay - cBalBBefore)) | |
867 | 867 | } | |
868 | 868 | else throw("Strict value is not equal to itself.") | |
869 | 869 | } | |
870 | 870 | else $Tuple2(tokensAmountA, tokensAmountB) | |
871 | - | let toUserAmountA = $ | |
872 | - | let toUserAmountB = $ | |
871 | + | let toUserAmountA = $t02506025756._1 | |
872 | + | let toUserAmountB = $t02506025756._2 | |
873 | 873 | $Tuple7(toUserAmountA, assetIdA, toUserAmountB, assetIdB, cBalAAfter, cBalBAfter, shareId) | |
874 | 874 | } | |
875 | 875 | else throw("Strict value is not equal to itself.") | |
876 | 876 | } | |
877 | 877 | else throw("Strict value is not equal to itself.") | |
878 | 878 | } | |
879 | 879 | else throw("Strict value is not equal to itself.") | |
880 | 880 | } | |
881 | 881 | ||
882 | 882 | ||
883 | 883 | func userCanWithdrawShareCalc (user,pool,posId,borrowed) = { | |
884 | 884 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
885 | 885 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)) | |
886 | 886 | let poolInterest = if (borrowed) | |
887 | 887 | then getIntegerValue(this, (pool + kPoolInterestLoan)) | |
888 | 888 | else getIntegerValue(this, (pool + kPoolInterestNoLoan)) | |
889 | 889 | (pAmount + fraction(pAmount, (poolInterest - userInterest), SCALE10)) | |
890 | 890 | } | |
891 | 891 | ||
892 | 892 | ||
893 | 893 | func withdrawToUser (user,pool,posId,stopLoss) = { | |
894 | 894 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
895 | - | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)) | |
896 | 895 | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)), 0) | |
897 | 896 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0)) | |
898 | 897 | let poolTotalShare = getPoolTotalShare(pool) | |
899 | 898 | let userAddr = Address(fromBase58String(user)) | |
900 | 899 | let borrowAsset = valueOrElse(getString(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)), "") | |
901 | 900 | let debt = if ((borrowAmount > 0)) | |
902 | 901 | then { | |
903 | 902 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posId), borrowAsset], nil) | |
904 | 903 | if ($isInstanceOf(@, "Int")) | |
905 | 904 | then @ | |
906 | 905 | else throw(($getType(@) + " couldn't be cast to Int")) | |
907 | 906 | } | |
908 | 907 | else 0 | |
909 | - | let $ | |
910 | - | if (($ | |
908 | + | let $t02715627309 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset) | |
909 | + | if (($t02715627309 == $t02715627309)) | |
911 | 910 | then { | |
912 | - | let shareId = $ | |
913 | - | let cBalBAfter = $ | |
914 | - | let cBalAAfter = $ | |
915 | - | let assetIdB = $ | |
916 | - | let toUserAmountB = $ | |
917 | - | let assetIdA = $ | |
918 | - | let toUserAmountA = $ | |
911 | + | let shareId = $t02715627309._7 | |
912 | + | let cBalBAfter = $t02715627309._6 | |
913 | + | let cBalAAfter = $t02715627309._5 | |
914 | + | let assetIdB = $t02715627309._4 | |
915 | + | let toUserAmountB = $t02715627309._3 | |
916 | + | let assetIdA = $t02715627309._2 | |
917 | + | let toUserAmountA = $t02715627309._1 | |
919 | 918 | let closeDbtInv = if ((debt > 0)) | |
920 | 919 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
921 | 920 | else 0 | |
922 | 921 | if ((closeDbtInv == closeDbtInv)) | |
923 | 922 | then ([DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, toUserAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, toUserAmountB, assetIdFromStr(assetIdB))] ++ getCursEntries(assetIdA, assetIdB, shareId)) | |
924 | 923 | else throw("Strict value is not equal to itself.") | |
925 | 924 | } | |
926 | 925 | else throw("Strict value is not equal to itself.") | |
927 | 926 | } | |
928 | 927 | ||
929 | 928 | ||
930 | 929 | func parseRequest (requestId) = { | |
931 | 930 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
932 | 931 | let user = request[0] | |
933 | 932 | let pool = request[1] | |
934 | 933 | let pmtA = parseIntValue(request[2]) | |
935 | 934 | let AId = request[3] | |
936 | 935 | let pmtB = parseIntValue(request[4]) | |
937 | 936 | let BId = request[5] | |
938 | 937 | let balA = parseIntValue(request[6]) | |
939 | 938 | let balB = parseIntValue(request[7]) | |
940 | 939 | let shareId = request[8] | |
941 | 940 | let bwAsset = request[9] | |
942 | 941 | let bwAmount = parseIntValue(request[10]) | |
943 | 942 | $Tuple11(user, pool, pmtA, AId, pmtB, BId, balA, balB, shareId, bwAsset, bwAmount) | |
944 | 943 | } | |
945 | 944 | ||
946 | 945 | ||
947 | 946 | func calcBorrowAmount (pmtA,pmtB,aId,bId,leverage,borrowId) = { | |
948 | 947 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [aId, false], nil) | |
949 | 948 | if ($isInstanceOf(@, "(Int, Int)")) | |
950 | 949 | then @ | |
951 | 950 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
952 | 951 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [bId, false], nil) | |
953 | 952 | if ($isInstanceOf(@, "(Int, Int)")) | |
954 | 953 | then @ | |
955 | 954 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
956 | 955 | let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
957 | 956 | let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
958 | 957 | let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB)) | |
959 | - | let $ | |
958 | + | let $t02899529092 = if ((borrowId == aId)) | |
960 | 959 | then $Tuple2(dPriceA, decPrA) | |
961 | 960 | else $Tuple2(dPriceB, decPrB) | |
962 | - | let borrowPrice = $ | |
963 | - | let borrowDecPr = $ | |
961 | + | let borrowPrice = $t02899529092._1 | |
962 | + | let borrowDecPr = $t02899529092._2 | |
964 | 963 | fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice) | |
965 | 964 | } | |
966 | 965 | ||
967 | 966 | ||
968 | 967 | @Callable(i) | |
969 | 968 | func calcPriceImpactEVALONLY (pool,leverage,borrowId,pmtA,pmtB) = if (if ((100 > leverage)) | |
970 | 969 | then true | |
971 | 970 | else (leverage > 300)) | |
972 | 971 | then throw("Leverage can't be <100 and >300") | |
973 | 972 | else { | |
974 | 973 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
975 | - | let $ | |
976 | - | let AId = $ | |
977 | - | let BId = $ | |
978 | - | let balA = $ | |
979 | - | let balB = $ | |
980 | - | let shareId = $ | |
974 | + | let $t02951029600 = getPoolData(Address(fromBase58String(pool)), pType) | |
975 | + | let AId = $t02951029600._1 | |
976 | + | let BId = $t02951029600._2 | |
977 | + | let balA = $t02951029600._3 | |
978 | + | let balB = $t02951029600._4 | |
979 | + | let shareId = $t02951029600._5 | |
981 | 980 | let borrowAmount = if ((leverage > 100)) | |
982 | 981 | then calcBorrowAmount(pmtA, pmtB, AId, BId, leverage, borrowId) | |
983 | 982 | else 0 | |
984 | - | let $ | |
983 | + | let $t02973529842 = if ((borrowId == AId)) | |
985 | 984 | then $Tuple2((pmtA + borrowAmount), pmtB) | |
986 | 985 | else $Tuple2(pmtA, (pmtB + borrowAmount)) | |
987 | - | let payInA = $ | |
988 | - | let payInB = $ | |
989 | - | let $ | |
990 | - | let lpAmount = $ | |
991 | - | let loss = $ | |
986 | + | let payInA = $t02973529842._1 | |
987 | + | let payInB = $t02973529842._2 | |
988 | + | let $t02984529938 = calcReplenishLPVirt(pType, pool, payInA, AId, payInB, BId, balA, balB) | |
989 | + | let lpAmount = $t02984529938._1 | |
990 | + | let loss = $t02984529938._2 | |
992 | 991 | let impactMod = if ((0 > loss)) | |
993 | 992 | then (loss * -1) | |
994 | 993 | else loss | |
995 | 994 | $Tuple2(nil, [impactMod]) | |
996 | 995 | } | |
997 | 996 | ||
998 | 997 | ||
999 | 998 | ||
1000 | 999 | @Callable(i) | |
1001 | 1000 | func getShareAssetPriceREADONLY (shareId) = { | |
1002 | 1001 | let sharePrices = getSharePrice(shareId) | |
1003 | 1002 | $Tuple2(nil, sharePrices) | |
1004 | 1003 | } | |
1005 | 1004 | ||
1006 | 1005 | ||
1007 | 1006 | ||
1008 | 1007 | @Callable(i) | |
1009 | 1008 | func getUserPositionShareAmountREADONLY (user,posNum) = { | |
1010 | 1009 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posNum) + kUserPositionPool)), "Unknown position") | |
1011 | 1010 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posNum) + kUserBorrowAmount)) | |
1012 | 1011 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum, (borrowAmount > 0)) | |
1013 | 1012 | $Tuple2(nil, userCanWithdraw) | |
1014 | 1013 | } | |
1015 | 1014 | ||
1016 | 1015 | ||
1017 | 1016 | ||
1018 | 1017 | @Callable(i) | |
1019 | 1018 | func getUserPositionInDollarsREADONLY (user,pools,posNum) = { | |
1020 | 1019 | func userPos (a,pool) = { | |
1021 | - | let $ | |
1022 | - | let totalPos = $ | |
1023 | - | let posDebt = $ | |
1024 | - | let index = $ | |
1020 | + | let $t03075130785 = a | |
1021 | + | let totalPos = $t03075130785._1 | |
1022 | + | let posDebt = $t03075130785._2 | |
1023 | + | let index = $t03075130785._3 | |
1025 | 1024 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1026 | - | let $ | |
1027 | - | let AId = $ | |
1028 | - | let BId = $ | |
1029 | - | let balA = $ | |
1030 | - | let balB = $ | |
1031 | - | let shareId = $ | |
1025 | + | let $t03087730967 = getPoolData(Address(fromBase58String(pool)), pType) | |
1026 | + | let AId = $t03087730967._1 | |
1027 | + | let BId = $t03087730967._2 | |
1028 | + | let balA = $t03087730967._3 | |
1029 | + | let balB = $t03087730967._4 | |
1030 | + | let shareId = $t03087730967._5 | |
1032 | 1031 | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0) | |
1033 | 1032 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0)) | |
1034 | 1033 | let sharePrices = getSharePrice(shareId) | |
1035 | 1034 | let decPrShare = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN) | |
1036 | 1035 | let shareD = fraction(userCanWithdraw, sharePrices, decPrShare) | |
1037 | 1036 | if ((borrowAmount == 0)) | |
1038 | 1037 | then $Tuple3((totalPos :+ shareD), (posDebt :+ 0), (index + 1)) | |
1039 | 1038 | else { | |
1040 | 1039 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAssetId)) | |
1041 | 1040 | let debt = { | |
1042 | 1041 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posNum[index]), borrowAsset], nil) | |
1043 | 1042 | if ($isInstanceOf(@, "Int")) | |
1044 | 1043 | then @ | |
1045 | 1044 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1046 | 1045 | } | |
1047 | 1046 | let borrowAssetPrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [borrowAsset, false], nil) | |
1048 | 1047 | if ($isInstanceOf(@, "(Int, Int)")) | |
1049 | 1048 | then @ | |
1050 | 1049 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
1051 | 1050 | let decPrBorrowId = pow(10, 0, getAssetDecimals(borrowAsset), 0, 0, DOWN) | |
1052 | 1051 | let debtD = fraction(debt, borrowAssetPrice, decPrBorrowId) | |
1053 | 1052 | $Tuple3((totalPos :+ shareD), (posDebt :+ debtD), (index + 1)) | |
1054 | 1053 | } | |
1055 | 1054 | } | |
1056 | 1055 | ||
1057 | - | let $ | |
1056 | + | let $t03201032065 = { | |
1058 | 1057 | let $l = pools | |
1059 | 1058 | let $s = size($l) | |
1060 | 1059 | let $acc0 = $Tuple3(nil, nil, 0) | |
1061 | 1060 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1062 | 1061 | then $a | |
1063 | 1062 | else userPos($a, $l[$i]) | |
1064 | 1063 | ||
1065 | 1064 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1066 | 1065 | then $a | |
1067 | 1066 | else throw("List size exceeds 20") | |
1068 | 1067 | ||
1069 | 1068 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
1070 | 1069 | } | |
1071 | - | let pos = $ | |
1072 | - | let debt = $ | |
1070 | + | let pos = $t03201032065._1 | |
1071 | + | let debt = $t03201032065._2 | |
1073 | 1072 | $Tuple2(nil, $Tuple2(pos, debt)) | |
1074 | 1073 | } | |
1075 | 1074 | ||
1076 | 1075 | ||
1077 | 1076 | ||
1078 | 1077 | @Callable(i) | |
1079 | 1078 | func replenish (pool,leverage,borrowId) = if (if ((100 > leverage)) | |
1080 | 1079 | then true | |
1081 | 1080 | else (leverage > 300)) | |
1082 | 1081 | then throw("Leverage can't be <100 and >300") | |
1083 | 1082 | else { | |
1084 | 1083 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1085 | - | let $ | |
1086 | - | let AId = $ | |
1087 | - | let BId = $ | |
1088 | - | let balA = $ | |
1089 | - | let balB = $ | |
1090 | - | let shareId = $ | |
1091 | - | let $ | |
1084 | + | let $t03238832478 = getPoolData(Address(fromBase58String(pool)), pType) | |
1085 | + | let AId = $t03238832478._1 | |
1086 | + | let BId = $t03238832478._2 | |
1087 | + | let balA = $t03238832478._3 | |
1088 | + | let balB = $t03238832478._4 | |
1089 | + | let shareId = $t03238832478._5 | |
1090 | + | let $t03248133118 = if ((size(i.payments) == 2)) | |
1092 | 1091 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
1093 | 1092 | then throw("Wrong payment asset A") | |
1094 | 1093 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
1095 | 1094 | then throw("Wrong payment asset B") | |
1096 | 1095 | else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId) | |
1097 | 1096 | else if ((size(i.payments) == 1)) | |
1098 | 1097 | then if ((assetIdToStr(i.payments[0].assetId) == AId)) | |
1099 | 1098 | then $Tuple4(i.payments[0].amount, AId, 0, BId) | |
1100 | 1099 | else if ((assetIdToStr(i.payments[0].assetId) == BId)) | |
1101 | 1100 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
1102 | 1101 | else throw("Wrong payment") | |
1103 | 1102 | else throw("One or two payments expected") | |
1104 | - | let pmtA = $ | |
1105 | - | let pmtAssetA = $ | |
1106 | - | let pmtB = $ | |
1107 | - | let pmtAssetB = $ | |
1103 | + | let pmtA = $t03248133118._1 | |
1104 | + | let pmtAssetA = $t03248133118._2 | |
1105 | + | let pmtB = $t03248133118._3 | |
1106 | + | let pmtAssetB = $t03248133118._4 | |
1108 | 1107 | let newPosNum = getNewUserPositionNumber(toString(i.caller)) | |
1109 | 1108 | if ((leverage > 100)) | |
1110 | 1109 | then { | |
1111 | 1110 | let borrowAmount = calcBorrowAmount(pmtA, pmtB, pmtAssetA, pmtAssetB, leverage, borrowId) | |
1112 | 1111 | let request = makeString([toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowId, toString(borrowAmount)], ",") | |
1113 | 1112 | let newRequestId = { | |
1114 | 1113 | let @ = invoke(this, "createNewRequest", [request], nil) | |
1115 | 1114 | if ($isInstanceOf(@, "Int")) | |
1116 | 1115 | then @ | |
1117 | 1116 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1118 | 1117 | } | |
1119 | 1118 | if ((newRequestId == newRequestId)) | |
1120 | 1119 | then { | |
1121 | 1120 | let args = [((toString(i.caller) + "_") + toString(newPosNum)), shareId, borrowId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
1122 | 1121 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
1123 | 1122 | if ((inv == inv)) | |
1124 | 1123 | then nil | |
1125 | 1124 | else throw("Strict value is not equal to itself.") | |
1126 | 1125 | } | |
1127 | 1126 | else throw("Strict value is not equal to itself.") | |
1128 | 1127 | } | |
1129 | 1128 | else { | |
1130 | - | let $ | |
1131 | - | let userStaked = $ | |
1132 | - | let axlyFee = $ | |
1129 | + | let $t03404634158 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1130 | + | let userStaked = $t03404634158._1 | |
1131 | + | let axlyFee = $t03404634158._2 | |
1133 | 1132 | (replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId)) | |
1134 | 1133 | } | |
1135 | 1134 | } | |
1136 | 1135 | ||
1137 | 1136 | ||
1138 | 1137 | ||
1139 | 1138 | @Callable(i) | |
1140 | 1139 | func withdraw (pool,posId) = withdrawToUser(toString(i.caller), pool, toString(posId), false) | |
1141 | 1140 | ||
1142 | 1141 | ||
1143 | 1142 | ||
1144 | 1143 | @Callable(i) | |
1145 | 1144 | func createUpdateStopLoss (posId,poolId,assetId,price) = { | |
1146 | 1145 | let tokenOraclePrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil) | |
1147 | 1146 | if ($isInstanceOf(@, "(Int, Int)")) | |
1148 | 1147 | then @ | |
1149 | 1148 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
1150 | 1149 | if (!(isDefined(getInteger(this, (((((poolId + "_") + toString(i.caller)) + "_") + toString(posId)) + kUserPosition))))) | |
1151 | 1150 | then throw("There are no user position") | |
1152 | 1151 | else if ((0 >= price)) | |
1153 | 1152 | then throw("Price must be greater than 0") | |
1154 | 1153 | else if ((price > tokenOraclePrice)) | |
1155 | 1154 | then throw("Price must be less than current token price") | |
1156 | 1155 | else [IntegerEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss), price)] | |
1157 | 1156 | } | |
1158 | 1157 | ||
1159 | 1158 | ||
1160 | 1159 | ||
1161 | 1160 | @Callable(i) | |
1162 | 1161 | func deleteStopLoss (posId,poolId,assetId) = if (!(isDefined(getInteger(this, (((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))))) | |
1163 | 1162 | then throw("No entry") | |
1164 | 1163 | else [DeleteEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))] | |
1165 | 1164 | ||
1166 | 1165 | ||
1167 | 1166 | ||
1168 | 1167 | @Callable(i) | |
1169 | 1168 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
1170 | 1169 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
1171 | 1170 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId) | |
1172 | 1171 | }) | |
1173 | 1172 | ||
1174 | 1173 | ||
1175 | 1174 | ||
1176 | 1175 | @Callable(i) | |
1177 | 1176 | func replenishFromLand (requestId) = valueOrElse(isLandCall(i), { | |
1178 | - | let $ | |
1179 | - | let user = $ | |
1180 | - | let pool = $ | |
1181 | - | let pmtA = $ | |
1182 | - | let AId = $ | |
1183 | - | let pmtB = $ | |
1184 | - | let BId = $ | |
1185 | - | let balA = $ | |
1186 | - | let balB = $ | |
1187 | - | let shareId = $ | |
1188 | - | let bwAsset = $ | |
1189 | - | let bwAmount = $ | |
1177 | + | let $t03591136015 = parseRequest(requestId) | |
1178 | + | let user = $t03591136015._1 | |
1179 | + | let pool = $t03591136015._2 | |
1180 | + | let pmtA = $t03591136015._3 | |
1181 | + | let AId = $t03591136015._4 | |
1182 | + | let pmtB = $t03591136015._5 | |
1183 | + | let BId = $t03591136015._6 | |
1184 | + | let balA = $t03591136015._7 | |
1185 | + | let balB = $t03591136015._8 | |
1186 | + | let shareId = $t03591136015._9 | |
1187 | + | let bwAsset = $t03591136015._10 | |
1188 | + | let bwAmount = $t03591136015._11 | |
1190 | 1189 | if ((size(i.payments) != 1)) | |
1191 | 1190 | then throw("Wrong payment size") | |
1192 | 1191 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
1193 | 1192 | then true | |
1194 | 1193 | else (i.payments[0].amount != bwAmount)) | |
1195 | 1194 | then throw("Wrong payment") | |
1196 | 1195 | else { | |
1197 | - | let $ | |
1196 | + | let $t03620536329 = if ((AId == bwAsset)) | |
1198 | 1197 | then $Tuple2((pmtA + i.payments[0].amount), pmtB) | |
1199 | 1198 | else $Tuple2(pmtA, (pmtB + i.payments[0].amount)) | |
1200 | - | let pmtAllA = $ | |
1201 | - | let pmtAllB = $ | |
1199 | + | let pmtAllA = $t03620536329._1 | |
1200 | + | let pmtAllB = $t03620536329._2 | |
1202 | 1201 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
1203 | - | let $ | |
1204 | - | let userStaked = $ | |
1205 | - | let axlyFee = $ | |
1202 | + | let $t03641136526 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId) | |
1203 | + | let userStaked = $t03641136526._1 | |
1204 | + | let axlyFee = $t03641136526._2 | |
1206 | 1205 | let posNum = getNewUserPositionNumber(user) | |
1207 | 1206 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
1208 | 1207 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
1209 | 1208 | $Tuple2((((entries ++ getCursEntries(AId, BId, shareId)) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
1210 | 1209 | } | |
1211 | 1210 | }) | |
1212 | 1211 | ||
1213 | 1212 | ||
1214 | 1213 | ||
1215 | 1214 | @Callable(i) | |
1216 | 1215 | func liquidate (user,posId,liquidateAmount) = valueOrElse(isLandCall(i), { | |
1217 | 1216 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1218 | 1217 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1219 | - | let $ | |
1220 | - | let AId = $ | |
1221 | - | let BId = $ | |
1222 | - | let balA = $ | |
1223 | - | let balB = $ | |
1224 | - | let shareId = $ | |
1218 | + | let $t03730537395 = getPoolData(Address(fromBase58String(pool)), pType) | |
1219 | + | let AId = $t03730537395._1 | |
1220 | + | let BId = $t03730537395._2 | |
1221 | + | let balA = $t03730537395._3 | |
1222 | + | let balB = $t03730537395._4 | |
1223 | + | let shareId = $t03730537395._5 | |
1225 | 1224 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1226 | 1225 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1227 | 1226 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1228 | 1227 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0)) | |
1229 | 1228 | if ((borrowAmount == 0)) | |
1230 | 1229 | then throw("You can't liquidate position without borrow") | |
1231 | 1230 | else [IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest), getIntegerValue(this, (pool + kPoolInterestLoan))), IntegerEntry((pool + kPoolTotalLoan), (getPoolTotalShareWithLoan(pool) - liquidateAmount)), IntegerEntry((pool + kPoolTotal), (getPoolTotalShare(pool) - liquidateAmount)), IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition), (userCanWithdraw - liquidateAmount)), ScriptTransfer(i.caller, amount, fromBase58String(shareId))] | |
1232 | 1231 | }) | |
1233 | 1232 | ||
1234 | 1233 | ||
1235 | 1234 | ||
1236 | 1235 | @Callable(i) | |
1237 | 1236 | func stopLoss (user,posId,pool,assetId) = valueOrElse(isAdminCall(i), { | |
1238 | 1237 | let tokenOraclePrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil) | |
1239 | 1238 | if ($isInstanceOf(@, "(Int, Int)")) | |
1240 | 1239 | then @ | |
1241 | 1240 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
1242 | 1241 | if (!(isDefined(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))))) | |
1243 | 1242 | then throw("No entry") | |
1244 | 1243 | else (withdrawToUser(toString(i.caller), pool, toString(posId), true) :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))) | |
1245 | 1244 | }) | |
1246 | 1245 | ||
1247 | 1246 | ||
1248 | 1247 | ||
1249 | 1248 | @Callable(i) | |
1250 | 1249 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = valueOrElse(isAdminCall(i), { | |
1251 | - | let $ | |
1250 | + | let $t03918139375 = if (claim) | |
1252 | 1251 | then claimFarmed(type, pool) | |
1253 | 1252 | else { | |
1254 | 1253 | let claimedAsset = if ((type == SF_POOL)) | |
1255 | 1254 | then SWOPID | |
1256 | 1255 | else WXID | |
1257 | 1256 | $Tuple2(amountToExchange, claimedAsset) | |
1258 | 1257 | } | |
1259 | - | let claimedAmount = $ | |
1260 | - | let claimedAsset = $ | |
1258 | + | let claimedAmount = $t03918139375._1 | |
1259 | + | let claimedAsset = $t03918139375._2 | |
1261 | 1260 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
1262 | 1261 | let change = (claimedAmount - amountToExchange) | |
1263 | 1262 | let changeEntry = if ((change > 0)) | |
1264 | 1263 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
1265 | 1264 | else nil | |
1266 | 1265 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
1267 | 1266 | }) | |
1268 | 1267 | ||
1269 | 1268 | ||
1270 | 1269 | ||
1271 | 1270 | @Callable(i) | |
1272 | 1271 | func capitalizeExPuzzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = valueOrElse(isAdminCall(i), { | |
1273 | - | let $ | |
1272 | + | let $t04006040254 = if (claim) | |
1274 | 1273 | then claimFarmed(type, pool) | |
1275 | 1274 | else { | |
1276 | 1275 | let claimedAsset = if ((type == SF_POOL)) | |
1277 | 1276 | then SWOPID | |
1278 | 1277 | else WXID | |
1279 | 1278 | $Tuple2(amountToExchange, claimedAsset) | |
1280 | 1279 | } | |
1281 | - | let claimedAmount = $ | |
1282 | - | let claimedAsset = $ | |
1280 | + | let claimedAmount = $t04006040254._1 | |
1281 | + | let claimedAsset = $t04006040254._2 | |
1283 | 1282 | let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
1284 | 1283 | let change = (claimedAmount - amountToExchange) | |
1285 | 1284 | let changeEntry = if ((change > 0)) | |
1286 | 1285 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
1287 | 1286 | else nil | |
1288 | 1287 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
1289 | 1288 | }) | |
1290 | 1289 | ||
1291 | 1290 | ||
1292 | 1291 | ||
1293 | 1292 | @Callable(i) | |
1294 | 1293 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = valueOrElse(isAdminCall(i), { | |
1295 | - | let $ | |
1294 | + | let $t04100541199 = if (claim) | |
1296 | 1295 | then claimFarmed(type, pool) | |
1297 | 1296 | else { | |
1298 | 1297 | let claimedAsset = if ((type == SF_POOL)) | |
1299 | 1298 | then SWOPID | |
1300 | 1299 | else WXID | |
1301 | 1300 | $Tuple2(amountToExchange, claimedAsset) | |
1302 | 1301 | } | |
1303 | - | let claimedAmount = $ | |
1304 | - | let claimedAsset = $ | |
1302 | + | let claimedAmount = $t04100541199._1 | |
1303 | + | let claimedAsset = $t04100541199._2 | |
1305 | 1304 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
1306 | 1305 | let change = (claimedAmount - amountToExchange) | |
1307 | 1306 | let changeEntry = if ((change > 0)) | |
1308 | 1307 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
1309 | 1308 | else nil | |
1310 | 1309 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
1311 | 1310 | }) | |
1312 | 1311 | ||
1313 | 1312 | ||
1314 | 1313 | ||
1315 | 1314 | @Callable(i) | |
1316 | 1315 | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan,stoplossFeeNoLoan,stoplossFeeWithLoan) = valueOrElse(isAdminCall(i), if (if ((type != SF_POOL)) | |
1317 | 1316 | then (type != WX_POOL) | |
1318 | 1317 | else false) | |
1319 | 1318 | then throw("Wrong type") | |
1320 | 1319 | else { | |
1321 | - | let $ | |
1322 | - | let aId = $ | |
1323 | - | let bId = $ | |
1324 | - | let aBal = $ | |
1325 | - | let bBal = $ | |
1326 | - | let shareId = $ | |
1320 | + | let $t04192042014 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1321 | + | let aId = $t04192042014._1 | |
1322 | + | let bId = $t04192042014._2 | |
1323 | + | let aBal = $t04192042014._3 | |
1324 | + | let bBal = $t04192042014._4 | |
1325 | + | let shareId = $t04192042014._5 | |
1327 | 1326 | [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kAxlyStopLossNoLoanFee), stoplossFeeNoLoan), IntegerEntry((poolAddr + kAxlyStopLossLoanFee), stoplossFeeWithLoan), IntegerEntry((poolAddr + kPoolInterestLoan), 0), IntegerEntry((poolAddr + kPoolInterestNoLoan), 0), StringEntry((kPool + poolAddr), type), StringEntry((shareId + kSharePool), poolAddr)] | |
1328 | 1327 | }) | |
1329 | 1328 | ||
1330 | 1329 | ||
1331 | 1330 | @Verifier(tx) | |
1332 | 1331 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
1333 | 1332 |
github/deemru/w8io/026f985 186.76 ms ◑