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