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