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