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