tx · DSF66GStJe5vyjV8emZZXmJMmJsMeG52mGBqK5ABjmrd 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.53000000 Waves 2023.10.18 13:04 [2803901] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "DSF66GStJe5vyjV8emZZXmJMmJsMeG52mGBqK5ABjmrd", "fee": 53000000, "feeAssetId": null, "timestamp": 1697623455911, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "4jsMDm9zvRXXNQdNXNztabkUP4bJ5C1MLWwLbj9JQFMg1jqEVKaDuz71nhnVh6rHLMXxsU5Q3BMQ47j98QUHe6Bf" ], "script": "base64:BgKiAQgCEgMKAQgSAwoBCBIECgIICBIFCgMIGBgSBQoDCAEIEgQKAggBEgYKBAEICAESBQoDAQgIEg8KDQgICAgICAgICAgICAgSAwoBCBIDCgEIEgUKAwgIARIGCgQIAQgIEgcKBQgICAEEEgUKAwgEARIMCgoICAgBAQEBAQEEEgkKBwgBAQEBAQESABIAEgASABIAEgASABIAEgMKAQgSAwoBCIUBAAdTRl9QT09MAgJTRgAHV1hfUE9PTAICV1gABENQTU0CBGNwbW0ABEZMQVQCBGZsYXQAD0NBUF9GRUVfTk9fTE9BTgIJY2FwTm9Mb2FuAAxDQVBfRkVFX0xPQU4CB2NhcExvYW4AFFNUT1BMT1NTX0ZFRV9OT19MT0FOAg5zdG9wTG9zc05vTG9hbgANU1RPUExPU1NfTE9BTgIMc3RvcExvc3NMb2FuAAhMT0FOX0ZFRQIEbG9hbgALTk9fTE9BTl9GRUUCBm5vTG9hbgAGTk9fRkVFAgVub0ZlZQAGU0NBTEU4AIDC1y8AB1NDQUxFMTAAgMivoCUAB1NDQUxFMTYJALYCAQCAgIT+pt7hEQAKRkVFX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CAIFBHRoaXMJAKwCAgUHV1hfUE9PTAULa0FjdGl2ZVNGV1gGCQACAQITV1ggYWxyZWFkeSBzaHV0ZG93bgkAzAgCCQEMQm9vbGVhbkVudHJ5AgkArAICBQdXWF9QT09MBQtrQWN0aXZlU0ZXWAcFA25pbAFpAQxhY3RpdmF0ZVBvb2wBBHBvb2wJAQt2YWx1ZU9yRWxzZQIJAQtpc0FkbWluQ2FsbAEFAWkDCQEBIQEJAQlpc0RlZmluZWQBCQCdCAIFBHRoaXMJAKwCAgUFa1Bvb2wFBHBvb2wJAAIBAgxVbmtub3duIHBvb2wDCQELdmFsdWVPckVsc2UCCQCbCAIFBHRoaXMJAKwCAgUEcG9vbAULa1Bvb2xBY3RpdmUGCQACAQITUG9vbCBhbHJlYWR5IGFjdGl2ZQkAzAgCCQEMQm9vbGVhbkVudHJ5AgkArAICBQRwb29sBQtrUG9vbEFjdGl2ZQYFA25pbAFpAQxzaHV0ZG93blBvb2wBBHBvb2wJAQt2YWx1ZU9yRWxzZQIJAQtpc0FkbWluQ2FsbAEFAWkDCQEBIQEJAQlpc0RlZmluZWQBCQCdCAIFBHRoaXMJAKwCAgUFa1Bvb2wFBHBvb2wJAAIBAgxVbmtub3duIHBvb2wDCQEBIQEJAQt2YWx1ZU9yRWxzZQIJAJsIAgUEdGhpcwkArAICBQRwb29sBQtrUG9vbEFjdGl2ZQYJAAIBAhVQb29sIGFscmVhZHkgc2h1dGRvd24JAMwIAgkBDEJvb2xlYW5FbnRyeQIJAKwCAgUEcG9vbAULa1Bvb2xBY3RpdmUHBQNuaWwAG1VqsA==", "height": 2803901, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CUiARNrn5WceECGMy34NycbZ3AfeBxHLYWXWzM8bYR5u Next: 4M2PVDWnzvVtmNfFftF8nMZfRvKBHCoeedabQqmhBELP Diff:
Old | New | Differences | |
---|---|---|---|
84 | 84 | let kRequestIter = "requests_iter" | |
85 | 85 | ||
86 | 86 | let kPool = "pool_" | |
87 | + | ||
88 | + | let kPoolType = "_poolType" | |
87 | 89 | ||
88 | 90 | let kSharePool = "_poolShareId" | |
89 | 91 | ||
238 | 240 | ||
239 | 241 | ||
240 | 242 | func getSFPoolData (poolAddr) = { | |
241 | - | let $ | |
242 | - | if (($ | |
243 | + | let $t080898138 = getSFPoolBalances(poolAddr) | |
244 | + | if (($t080898138 == $t080898138)) | |
243 | 245 | then { | |
244 | - | let balB = $ | |
245 | - | let balA = $ | |
246 | + | let balB = $t080898138._2 | |
247 | + | let balA = $t080898138._1 | |
246 | 248 | $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), balA, balB, valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id")) | |
247 | 249 | } | |
248 | 250 | else throw("Strict value is not equal to itself.") | |
276 | 278 | then @ | |
277 | 279 | else unit | |
278 | 280 | }, "Can't get pool LP asset id") | |
279 | - | let $ | |
280 | - | if (($ | |
281 | + | let $t088358894 = getWXPoolBalances(poolAddr, aId, bId) | |
282 | + | if (($t088358894 == $t088358894)) | |
281 | 283 | then { | |
282 | - | let balB = $ | |
283 | - | let balA = $ | |
284 | + | let balB = $t088358894._2 | |
285 | + | let balA = $t088358894._1 | |
284 | 286 | $Tuple5(aId, bId, balA, balB, shareId) | |
285 | 287 | } | |
286 | 288 | else throw("Strict value is not equal to itself.") | |
388 | 390 | let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id") | |
389 | 391 | let poolAddr = Address(fromBase58String(pool)) | |
390 | 392 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
391 | - | let $ | |
392 | - | let aId = $ | |
393 | - | let bId = $ | |
394 | - | let aBalance = $ | |
395 | - | let bBalance = $ | |
393 | + | let $t01188311948 = getPoolData(poolAddr, pType) | |
394 | + | let aId = $t01188311948._1 | |
395 | + | let bId = $t01188311948._2 | |
396 | + | let aBalance = $t01188311948._3 | |
397 | + | let bBalance = $t01188311948._4 | |
396 | 398 | let prices = getAssetsPrice([aId, bId]) | |
397 | 399 | let dPriceA = prices[0] | |
398 | 400 | let dPriceB = prices[1] | |
471 | 473 | } | |
472 | 474 | else if ((pType == WX_POOL)) | |
473 | 475 | then { | |
474 | - | let $ | |
476 | + | let $t01349213742 = $Tuple2(split({ | |
475 | 477 | let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil) | |
476 | 478 | if ($isInstanceOf(@, "String")) | |
477 | 479 | then @ | |
482 | 484 | then @ | |
483 | 485 | else throw(($getType(@) + " couldn't be cast to String")) | |
484 | 486 | }, "__")) | |
485 | - | if (($ | |
487 | + | if (($t01349213742 == $t01349213742)) | |
486 | 488 | then { | |
487 | - | let evalPutInB = $ | |
488 | - | let evalPutInA = $ | |
489 | + | let evalPutInB = $t01349213742._2 | |
490 | + | let evalPutInA = $t01349213742._1 | |
489 | 491 | let lpInA = parseIntValue(evalPutInA[1]) | |
490 | 492 | let lpInB = parseIntValue(evalPutInB[1]) | |
491 | 493 | if ((lpInB > lpInA)) | |
518 | 520 | if ((pType == SF_POOL)) | |
519 | 521 | then invoke(poolAddr, "callFunction", ["replenishWithOneToken", ["0", "false", "0"]], payments) | |
520 | 522 | else if ((pType == WX_POOL)) | |
521 | - | then invoke(poolAddr, "putOneTkn", [0, false], payments) | |
523 | + | then { | |
524 | + | let fc = if ((valueOrElse(getString(this, (toString(poolAddr) + kPoolType)), "cpmm") == FLAT)) | |
525 | + | then "putOneTknV2" | |
526 | + | else "putOneTkn" | |
527 | + | invoke(poolAddr, fc, [0, false], payments) | |
528 | + | } | |
522 | 529 | else unknownPoolType() | |
523 | 530 | } | |
524 | 531 | ||
534 | 541 | ||
535 | 542 | ||
536 | 543 | func unstakeLP (pool,pType,shareId,amount) = { | |
537 | - | let $ | |
544 | + | let $t01552015870 = if ((pType == SF_POOL)) | |
538 | 545 | then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount]) | |
539 | 546 | else if ((pType == WX_POOL)) | |
540 | 547 | then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount]) | |
541 | 548 | else unknownPoolType() | |
542 | - | let farmAddr = $ | |
543 | - | let fName = $ | |
544 | - | let params = $ | |
549 | + | let farmAddr = $t01552015870._1 | |
550 | + | let fName = $t01552015870._2 | |
551 | + | let params = $t01552015870._3 | |
545 | 552 | let inv = invoke(farmAddr, fName, params, nil) | |
546 | 553 | if ((inv == inv)) | |
547 | 554 | then amount | |
554 | 561 | let feeScale6 = 1000000 | |
555 | 562 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
556 | 563 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee), CEILING) | |
557 | - | let $ | |
564 | + | let $t01629216598 = if ((assetTokenToGet == assetIdA)) | |
558 | 565 | then { | |
559 | 566 | let amountToPay = fraction(amntGetNoFee, balB, (balA - amntGetNoFee), CEILING) | |
560 | 567 | $Tuple2(amountToPay, assetIdB) | |
563 | 570 | let amountToPay = fraction(amntGetNoFee, balA, (balB - amntGetNoFee), CEILING) | |
564 | 571 | $Tuple2(amountToPay, assetIdA) | |
565 | 572 | } | |
566 | - | let amountToPay = $ | |
567 | - | let assetToPay = $ | |
573 | + | let amountToPay = $t01629216598._1 | |
574 | + | let assetToPay = $t01629216598._2 | |
568 | 575 | $Tuple2(assetToPay, amountToPay) | |
569 | 576 | } | |
570 | 577 | ||
584 | 591 | ||
585 | 592 | ||
586 | 593 | func calcAmountToPayWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
587 | - | let $ | |
588 | - | let pFee = $ | |
589 | - | let prFee = $ | |
594 | + | let $t01733817377 = getWXSwapFees(pool) | |
595 | + | let pFee = $t01733817377._1 | |
596 | + | let prFee = $t01733817377._2 | |
590 | 597 | let feeScale = toBigInt(100000000) | |
591 | - | let $ | |
598 | + | let $t01741717725 = if ((assetTokenToGet == assetIdA)) | |
592 | 599 | then { | |
593 | 600 | let amountToPay = fraction(amountTokenToGet, balB, (balA - amountTokenToGet)) | |
594 | 601 | $Tuple2(amountToPay, assetIdB) | |
597 | 604 | let amountToPay = fraction(amountTokenToGet, balA, (balB - amountTokenToGet)) | |
598 | 605 | $Tuple2(amountToPay, assetIdA) | |
599 | 606 | } | |
600 | - | let amountToPay = $ | |
601 | - | let assetToPay = $ | |
607 | + | let amountToPay = $t01741717725._1 | |
608 | + | let assetToPay = $t01741717725._2 | |
602 | 609 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))), CEILING)) | |
603 | 610 | $Tuple2(assetToPay, amountToPayWithFee) | |
604 | 611 | } | |
610 | 617 | then true | |
611 | 618 | else (poolFB != "")) | |
612 | 619 | then { | |
613 | - | let $ | |
620 | + | let $t01816618378 = if ((poolFB == "")) | |
614 | 621 | then $Tuple3(balA, balB, pool) | |
615 | 622 | else { | |
616 | - | let $ | |
617 | - | let sfBalA = $ | |
618 | - | let sfBalB = $ | |
623 | + | let $t01827218345 = getSFPoolBalances(addressFromStringValue(poolFB)) | |
624 | + | let sfBalA = $t01827218345._1 | |
625 | + | let sfBalB = $t01827218345._2 | |
619 | 626 | $Tuple3(sfBalA, sfBalB, poolFB) | |
620 | 627 | } | |
621 | - | let pBalA = $ | |
622 | - | let pBalB = $ | |
623 | - | let exPool = $ | |
624 | - | let $ | |
625 | - | let assetToPay = $ | |
626 | - | let amountToPay = $ | |
628 | + | let pBalA = $t01816618378._1 | |
629 | + | let pBalB = $t01816618378._2 | |
630 | + | let exPool = $t01816618378._3 | |
631 | + | let $t01838318509 = calcAmountToPaySF(exPool, assetIdA, assetIdB, pBalA, pBalB, amountTokenToGet, assetTokenToGet) | |
632 | + | let assetToPay = $t01838318509._1 | |
633 | + | let amountToPay = $t01838318509._2 | |
627 | 634 | invoke(addressFromStringValue(exPool), "callFunction", ["exchange", [toString(amountTokenToGet)]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
628 | 635 | } | |
629 | 636 | else if ((pType == WX_POOL)) | |
630 | 637 | then { | |
631 | - | let $ | |
632 | - | let assetToPay = $ | |
633 | - | let amountToPay = $ | |
638 | + | let $t01871118833 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
639 | + | let assetToPay = $t01871118833._1 | |
640 | + | let amountToPay = $t01871118833._2 | |
634 | 641 | invoke(wxSwapContract, "swap", [amountTokenToGet, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
635 | 642 | } | |
636 | 643 | else unknownPoolType() | |
638 | 645 | ||
639 | 646 | ||
640 | 647 | func calcWithdrawLPFromPoolVirt (poolAddr,pType,shareId,userCanWithdraw) = { | |
641 | - | let $ | |
648 | + | let $t01912019584 = if ((pType == SF_POOL)) | |
642 | 649 | then { | |
643 | 650 | let inv = { | |
644 | 651 | let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(userCanWithdraw)]], nil) | |
673 | 680 | else throw("Strict value is not equal to itself.") | |
674 | 681 | } | |
675 | 682 | else unknownPoolType() | |
676 | - | let amountA = $ | |
677 | - | let amountB = $ | |
683 | + | let amountA = $t01912019584._1 | |
684 | + | let amountB = $t01912019584._2 | |
678 | 685 | $Tuple2(amountA, amountB) | |
679 | 686 | } | |
680 | 687 | ||
696 | 703 | } | |
697 | 704 | else if ((pType == WX_POOL)) | |
698 | 705 | then { | |
699 | - | let $ | |
700 | - | let aId = $ | |
701 | - | let bId = $ | |
702 | - | let aBal = $ | |
703 | - | let bBal = $ | |
704 | - | let lpId = $ | |
706 | + | let $t01995220031 = getWXPoolData(addressFromStringValue(pool)) | |
707 | + | let aId = $t01995220031._1 | |
708 | + | let bId = $t01995220031._2 | |
709 | + | let aBal = $t01995220031._3 | |
710 | + | let bBal = $t01995220031._4 | |
711 | + | let lpId = $t01995220031._5 | |
705 | 712 | let balBefore = accountBalance(WXID) | |
706 | 713 | if ((balBefore == balBefore)) | |
707 | 714 | then { | |
723 | 730 | if ((lpBalanceBefore == lpBalanceBefore)) | |
724 | 731 | then { | |
725 | 732 | let poolAddr = addressFromStringValue(pool) | |
726 | - | let $ | |
733 | + | let $t02062921045 = if (if ((pmtA > 0)) | |
727 | 734 | then (pmtB > 0) | |
728 | 735 | else false) | |
729 | 736 | then { | |
730 | - | let $ | |
731 | - | let pmtInA = $ | |
732 | - | let pmtInB = $ | |
733 | - | let change = $ | |
734 | - | let changeId = $ | |
737 | + | let $t02069520811 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
738 | + | let pmtInA = $t02069520811._1 | |
739 | + | let pmtInB = $t02069520811._2 | |
740 | + | let change = $t02069520811._3 | |
741 | + | let changeId = $t02069520811._4 | |
735 | 742 | let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId) | |
736 | 743 | if ((inv == inv)) | |
737 | 744 | then $Tuple2(change, changeId) | |
742 | 749 | else if ((pmtB > 0)) | |
743 | 750 | then $Tuple2(pmtB, bId) | |
744 | 751 | else throw("pmts must be > 0") | |
745 | - | let change = $ | |
746 | - | let changeId = $ | |
752 | + | let change = $t02062921045._1 | |
753 | + | let changeId = $t02062921045._2 | |
747 | 754 | let inv = if ((change > 0)) | |
748 | 755 | then replenishOneTokenByType(poolAddr, pType, change, changeId) | |
749 | 756 | else nil | |
771 | 778 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = { | |
772 | 779 | let totalAmount = getPoolTotalShare(pool) | |
773 | 780 | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
774 | - | let $ | |
781 | + | let $t02190222140 = if (withLoan) | |
775 | 782 | then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount)) | |
776 | 783 | else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan) | |
777 | - | let curPoolInterest = $ | |
778 | - | let totalStakedWithLoan = $ | |
784 | + | let curPoolInterest = $t02190222140._1 | |
785 | + | let totalStakedWithLoan = $t02190222140._2 | |
779 | 786 | [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))] | |
780 | 787 | } | |
781 | 788 | ||
856 | 863 | ||
857 | 864 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
858 | 865 | let poolAddr = Address(fromBase58String(pool)) | |
859 | - | let $ | |
860 | - | let AId = $ | |
861 | - | let BId = $ | |
862 | - | let balA = $ | |
863 | - | let balB = $ | |
864 | - | let shareId = $ | |
866 | + | let $t02424724313 = getPoolData(poolAddr, pType) | |
867 | + | let AId = $t02424724313._1 | |
868 | + | let BId = $t02424724313._2 | |
869 | + | let balA = $t02424724313._3 | |
870 | + | let balB = $t02424724313._4 | |
871 | + | let shareId = $t02424724313._5 | |
865 | 872 | if (if ((tokenId != AId)) | |
866 | 873 | then (tokenId != BId) | |
867 | 874 | else false) | |
878 | 885 | let axlyFeeLoan = fraction(tokensForFeeLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
879 | 886 | let axlyFeeNoLoan = fraction(tokensForFeeNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
880 | 887 | let axlyFee = (axlyFeeLoan + axlyFeeNoLoan) | |
881 | - | let $ | |
888 | + | let $t02505825158 = if ((tokenId == AId)) | |
882 | 889 | then $Tuple2((tokenAmount - axlyFee), 0) | |
883 | 890 | else $Tuple2(0, (tokenAmount - axlyFee)) | |
884 | - | let pmtA = $ | |
885 | - | let pmtB = $ | |
886 | - | let $ | |
887 | - | let stakedAmount = $ | |
888 | - | let nf = $ | |
891 | + | let pmtA = $t02505825158._1 | |
892 | + | let pmtB = $t02505825158._2 | |
893 | + | let $t02516125265 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
894 | + | let stakedAmount = $t02516125265._1 | |
895 | + | let nf = $t02516125265._2 | |
889 | 896 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
890 | 897 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
891 | 898 | let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8) | |
931 | 938 | let userAddr = Address(fromBase58String(user)) | |
932 | 939 | let poolAddr = Address(fromBase58String(pool)) | |
933 | 940 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
934 | - | let $ | |
935 | - | let idAStr = $ | |
936 | - | let idBStr = $ | |
937 | - | let balA = $ | |
938 | - | let balB = $ | |
939 | - | let shareId = $ | |
940 | - | let $ | |
941 | - | let idA = $ | |
942 | - | let idB = $ | |
941 | + | let $t02779427866 = getPoolData(poolAddr, pType) | |
942 | + | let idAStr = $t02779427866._1 | |
943 | + | let idBStr = $t02779427866._2 | |
944 | + | let balA = $t02779427866._3 | |
945 | + | let balB = $t02779427866._4 | |
946 | + | let shareId = $t02779427866._5 | |
947 | + | let $t02786927936 = $Tuple2(assetIdFromStr(idAStr), assetIdFromStr(idBStr)) | |
948 | + | let idA = $t02786927936._1 | |
949 | + | let idB = $t02786927936._2 | |
943 | 950 | let stopLossFee = calcStopLossFee(pool, isBorrowed, stopLoss, userCanWithdraw) | |
944 | 951 | let cBalABefore = accountBalance(idA) | |
945 | 952 | if ((cBalABefore == cBalABefore)) | |
970 | 977 | let cBalBAfter = accountBalance(idB) | |
971 | 978 | if ((cBalBAfter == cBalBAfter)) | |
972 | 979 | then { | |
973 | - | let $ | |
974 | - | let tokensAmountA = $ | |
975 | - | let tokensAmountB = $ | |
976 | - | let $ | |
980 | + | let $t02863128720 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
981 | + | let tokensAmountA = $t02863128720._1 | |
982 | + | let tokensAmountB = $t02863128720._2 | |
983 | + | let $t02872329959 = if (isBorrowed) | |
977 | 984 | then { | |
978 | 985 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
979 | 986 | let debt = { | |
1022 | 1029 | else throw("Strict value is not equal to itself.") | |
1023 | 1030 | } | |
1024 | 1031 | else $Tuple2(tokensAmountA, tokensAmountB) | |
1025 | - | let toUserA = $ | |
1026 | - | let toUserB = $ | |
1032 | + | let toUserA = $t02872329959._1 | |
1033 | + | let toUserB = $t02872329959._2 | |
1027 | 1034 | let poolTotalLoanEntries = if (isBorrowed) | |
1028 | 1035 | then [IntegerEntry((pool + kPoolTotalLoan), ((poolTotalShareLoan - userCanWithdraw) - stopLossFee))] | |
1029 | 1036 | else nil | |
1069 | 1076 | let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
1070 | 1077 | let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
1071 | 1078 | let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB)) | |
1072 | - | let $ | |
1079 | + | let $t03194132038 = if ((borrowId == aId)) | |
1073 | 1080 | then $Tuple2(dPriceA, decPrA) | |
1074 | 1081 | else $Tuple2(dPriceB, decPrB) | |
1075 | - | let borrowPrice = $ | |
1076 | - | let borrowDecPr = $ | |
1082 | + | let borrowPrice = $t03194132038._1 | |
1083 | + | let borrowDecPr = $t03194132038._2 | |
1077 | 1084 | fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice) | |
1078 | 1085 | } | |
1079 | 1086 | ||
1102 | 1109 | ||
1103 | 1110 | ||
1104 | 1111 | func claimAndCheckAmnt (pool,pType,claim,amount,change) = { | |
1105 | - | let $ | |
1112 | + | let $t03303833300 = if (claim) | |
1106 | 1113 | then claimFarmed(pType, pool) | |
1107 | 1114 | else { | |
1108 | 1115 | let claimedAsset = if ((pType == SF_POOL)) | |
1112 | 1119 | else unknownPoolType() | |
1113 | 1120 | $Tuple2(amount, claimedAsset) | |
1114 | 1121 | } | |
1115 | - | if (($ | |
1122 | + | if (($t03303833300 == $t03303833300)) | |
1116 | 1123 | then { | |
1117 | - | let claimAsset = $ | |
1118 | - | let claimAmount = $ | |
1124 | + | let claimAsset = $t03303833300._2 | |
1125 | + | let claimAmount = $t03303833300._1 | |
1119 | 1126 | let bal = accountBalance(claimAsset) | |
1120 | 1127 | if ((bal == bal)) | |
1121 | 1128 | then if ((amount > bal)) | |
1131 | 1138 | func getPoolInfoREADONLY (pool) = { | |
1132 | 1139 | let poolAddr = addressFromStringValue(pool) | |
1133 | 1140 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1134 | - | let $ | |
1135 | - | let AId = $ | |
1136 | - | let BId = $ | |
1137 | - | let balA = $ | |
1138 | - | let balB = $ | |
1139 | - | let shareId = $ | |
1141 | + | let $t03366733757 = getPoolData(Address(fromBase58String(pool)), pType) | |
1142 | + | let AId = $t03366733757._1 | |
1143 | + | let BId = $t03366733757._2 | |
1144 | + | let balA = $t03366733757._3 | |
1145 | + | let balB = $t03366733757._4 | |
1146 | + | let shareId = $t03366733757._5 | |
1140 | 1147 | let shareSupply = getShareSupply(poolAddr, pType, shareId) | |
1141 | 1148 | $Tuple2(nil, $Tuple6(AId, BId, shareId, balA, balB, shareSupply)) | |
1142 | 1149 | } | |
1164 | 1171 | @Callable(i) | |
1165 | 1172 | func getUserPositionREADONLY (user,pools,posNum) = { | |
1166 | 1173 | func userPos (a,pool) = { | |
1167 | - | let $ | |
1168 | - | let wAmountsA = $ | |
1169 | - | let wAmountsB = $ | |
1170 | - | let debts = $ | |
1171 | - | let eqWAmountsA = $ | |
1172 | - | let eqWAmountsB = $ | |
1173 | - | let index = $ | |
1174 | + | let $t03463034700 = a | |
1175 | + | let wAmountsA = $t03463034700._1 | |
1176 | + | let wAmountsB = $t03463034700._2 | |
1177 | + | let debts = $t03463034700._3 | |
1178 | + | let eqWAmountsA = $t03463034700._4 | |
1179 | + | let eqWAmountsB = $t03463034700._5 | |
1180 | + | let index = $t03463034700._6 | |
1174 | 1181 | if (!(isDefined(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserPosition))))) | |
1175 | 1182 | then $Tuple6((wAmountsA :+ 0), (wAmountsB :+ 0), (debts :+ 0), (eqWAmountsA :+ 0), (eqWAmountsB :+ 0), (index + 1)) | |
1176 | 1183 | else { | |
1177 | 1184 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1178 | - | let $ | |
1179 | - | let AId = $ | |
1180 | - | let BId = $ | |
1181 | - | let balA = $ | |
1182 | - | let balB = $ | |
1183 | - | let shareId = $ | |
1185 | + | let $t03497935069 = getPoolData(Address(fromBase58String(pool)), pType) | |
1186 | + | let AId = $t03497935069._1 | |
1187 | + | let BId = $t03497935069._2 | |
1188 | + | let balA = $t03497935069._3 | |
1189 | + | let balB = $t03497935069._4 | |
1190 | + | let shareId = $t03497935069._5 | |
1184 | 1191 | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0) | |
1185 | 1192 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0)) | |
1186 | - | let $ | |
1187 | - | let wAmountA = $ | |
1188 | - | let wAmountB = $ | |
1193 | + | let $t03528535405 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userCanWithdraw) | |
1194 | + | let wAmountA = $t03528535405._1 | |
1195 | + | let wAmountB = $t03528535405._2 | |
1189 | 1196 | if ((borrowAmount > 0)) | |
1190 | 1197 | then { | |
1191 | 1198 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAssetId)) | |
1219 | 1226 | } | |
1220 | 1227 | else unknownPoolType() | |
1221 | 1228 | else 0 | |
1222 | - | let $ | |
1229 | + | let $t03631736536 = if ((borrowAsset == AId)) | |
1223 | 1230 | then $Tuple2(((wAmountA + amountToGetEx) - debt), (wAmountB - amountToPay)) | |
1224 | 1231 | else $Tuple2((wAmountA - amountToPay), ((wAmountB + amountToGetEx) - debt)) | |
1225 | - | let eqWAmountA = $ | |
1226 | - | let eqWAmountB = $ | |
1232 | + | let eqWAmountA = $t03631736536._1 | |
1233 | + | let eqWAmountB = $t03631736536._2 | |
1227 | 1234 | $Tuple6((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (debts :+ debt), (eqWAmountsA :+ eqWAmountA), (eqWAmountsB :+ eqWAmountB), (index + 1)) | |
1228 | 1235 | } | |
1229 | 1236 | else throw("Strict value is not equal to itself.") | |
1232 | 1239 | } | |
1233 | 1240 | } | |
1234 | 1241 | ||
1235 | - | let $ | |
1242 | + | let $t03679136902 = { | |
1236 | 1243 | let $l = pools | |
1237 | 1244 | let $s = size($l) | |
1238 | 1245 | let $acc0 = $Tuple6(nil, nil, nil, nil, nil, 0) | |
1246 | 1253 | ||
1247 | 1254 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
1248 | 1255 | } | |
1249 | - | let wAmountsA = $ | |
1250 | - | let wAmountsB = $ | |
1251 | - | let debts = $ | |
1252 | - | let eqWAmountsA = $ | |
1253 | - | let eqWAmountsB = $ | |
1256 | + | let wAmountsA = $t03679136902._1 | |
1257 | + | let wAmountsB = $t03679136902._2 | |
1258 | + | let debts = $t03679136902._3 | |
1259 | + | let eqWAmountsA = $t03679136902._4 | |
1260 | + | let eqWAmountsB = $t03679136902._5 | |
1254 | 1261 | $Tuple2(nil, $Tuple5(wAmountsA, wAmountsB, debts, eqWAmountsA, eqWAmountsB)) | |
1255 | 1262 | } | |
1256 | 1263 | ||
1270 | 1277 | else false) | |
1271 | 1278 | then throw("You can't borrow in this pool") | |
1272 | 1279 | else { | |
1273 | - | let $ | |
1274 | - | let AId = $ | |
1275 | - | let BId = $ | |
1276 | - | let balA = $ | |
1277 | - | let balB = $ | |
1278 | - | let shareId = $ | |
1280 | + | let $t03750037590 = getPoolData(Address(fromBase58String(pool)), pType) | |
1281 | + | let AId = $t03750037590._1 | |
1282 | + | let BId = $t03750037590._2 | |
1283 | + | let balA = $t03750037590._3 | |
1284 | + | let balB = $t03750037590._4 | |
1285 | + | let shareId = $t03750037590._5 | |
1279 | 1286 | if (if ((borrowId != AId)) | |
1280 | 1287 | then (borrowId != BId) | |
1281 | 1288 | else false) | |
1282 | 1289 | then throw("Wrong borrow asset") | |
1283 | 1290 | else { | |
1284 | - | let $ | |
1285 | - | let pmtA = $ | |
1286 | - | let pmtB = $ | |
1291 | + | let $t03767137730 = parseReplenishPmts(i.payments, AId, BId) | |
1292 | + | let pmtA = $t03767137730._1 | |
1293 | + | let pmtB = $t03767137730._2 | |
1287 | 1294 | let user = toString(i.caller) | |
1288 | 1295 | let newPosNum = getNewUserPositionNumber(user) | |
1289 | 1296 | if ((leverage > 100)) | |
1303 | 1310 | if ((inv == inv)) | |
1304 | 1311 | then { | |
1305 | 1312 | let userStaked = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPosition)) | |
1306 | - | let $ | |
1307 | - | if (($ | |
1313 | + | let $t03871938813 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1314 | + | if (($t03871938813 == $t03871938813)) | |
1308 | 1315 | then { | |
1309 | - | let newBalB = $ | |
1310 | - | let newBalA = $ | |
1316 | + | let newBalB = $t03871938813._2 | |
1317 | + | let newBalA = $t03871938813._1 | |
1311 | 1318 | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1312 | - | let $ | |
1313 | - | let wAmountA = $ | |
1314 | - | let wAmountB = $ | |
1319 | + | let $t03888338998 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1320 | + | let wAmountA = $t03888338998._1 | |
1321 | + | let wAmountB = $t03888338998._2 | |
1315 | 1322 | $Tuple2(nil, [prImpact, wAmountA, wAmountB]) | |
1316 | 1323 | } | |
1317 | 1324 | else throw("Strict value is not equal to itself.") | |
1321 | 1328 | else throw("Strict value is not equal to itself.") | |
1322 | 1329 | } | |
1323 | 1330 | else { | |
1324 | - | let $ | |
1325 | - | if (($ | |
1331 | + | let $t03905139166 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1332 | + | if (($t03905139166 == $t03905139166)) | |
1326 | 1333 | then { | |
1327 | - | let axlyFee = $ | |
1328 | - | let userStaked = $ | |
1329 | - | let $ | |
1330 | - | if (($ | |
1334 | + | let axlyFee = $t03905139166._2 | |
1335 | + | let userStaked = $t03905139166._1 | |
1336 | + | let $t03917239266 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1337 | + | if (($t03917239266 == $t03917239266)) | |
1331 | 1338 | then { | |
1332 | - | let newBalB = $ | |
1333 | - | let newBalA = $ | |
1339 | + | let newBalB = $t03917239266._2 | |
1340 | + | let newBalA = $t03917239266._1 | |
1334 | 1341 | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1335 | - | let $ | |
1336 | - | let wAmountA = $ | |
1337 | - | let wAmountB = $ | |
1342 | + | let $t03933639451 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1343 | + | let wAmountA = $t03933639451._1 | |
1344 | + | let wAmountB = $t03933639451._2 | |
1338 | 1345 | $Tuple2((replenishEntries(pool, user, userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])), [prImpact, wAmountA, wAmountB]) | |
1339 | 1346 | } | |
1340 | 1347 | else throw("Strict value is not equal to itself.") | |
1427 | 1434 | ||
1428 | 1435 | @Callable(i) | |
1429 | 1436 | func replenishFromLand (requestId) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1430 | - | let $ | |
1431 | - | let user = $ | |
1432 | - | let pool = $ | |
1433 | - | let pmtA = $ | |
1434 | - | let AId = $ | |
1435 | - | let pmtB = $ | |
1436 | - | let BId = $ | |
1437 | - | let balA = $ | |
1438 | - | let balB = $ | |
1439 | - | let shareId = $ | |
1440 | - | let bwAsset = $ | |
1441 | - | let bwAmount = $ | |
1437 | + | let $t04429044394 = parseRequest(requestId) | |
1438 | + | let user = $t04429044394._1 | |
1439 | + | let pool = $t04429044394._2 | |
1440 | + | let pmtA = $t04429044394._3 | |
1441 | + | let AId = $t04429044394._4 | |
1442 | + | let pmtB = $t04429044394._5 | |
1443 | + | let BId = $t04429044394._6 | |
1444 | + | let balA = $t04429044394._7 | |
1445 | + | let balB = $t04429044394._8 | |
1446 | + | let shareId = $t04429044394._9 | |
1447 | + | let bwAsset = $t04429044394._10 | |
1448 | + | let bwAmount = $t04429044394._11 | |
1442 | 1449 | if ((size(i.payments) != 1)) | |
1443 | 1450 | then throw("Wrong payment size") | |
1444 | 1451 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
1446 | 1453 | else (i.payments[0].amount != bwAmount)) | |
1447 | 1454 | then throw("Wrong payment") | |
1448 | 1455 | else { | |
1449 | - | let $ | |
1456 | + | let $t04458444684 = if ((AId == bwAsset)) | |
1450 | 1457 | then $Tuple2((pmtA + bwAmount), pmtB) | |
1451 | 1458 | else $Tuple2(pmtA, (pmtB + bwAmount)) | |
1452 | - | let pmtAllA = $ | |
1453 | - | let pmtAllB = $ | |
1459 | + | let pmtAllA = $t04458444684._1 | |
1460 | + | let pmtAllB = $t04458444684._2 | |
1454 | 1461 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
1455 | - | let $ | |
1456 | - | let userStaked = $ | |
1457 | - | let axlyFee = $ | |
1462 | + | let $t04476644881 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId) | |
1463 | + | let userStaked = $t04476644881._1 | |
1464 | + | let axlyFee = $t04476644881._2 | |
1458 | 1465 | let posNum = getNewUserPositionNumber(user) | |
1459 | 1466 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
1460 | 1467 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
1461 | - | let $ | |
1462 | - | let wAmountA = $ | |
1463 | - | let wAmountB = $ | |
1468 | + | let $t04524145356 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1469 | + | let wAmountA = $t04524145356._1 | |
1470 | + | let wAmountB = $t04524145356._2 | |
1464 | 1471 | $Tuple2((((entries ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
1465 | 1472 | } | |
1466 | 1473 | })) | |
1471 | 1478 | func liquidate (user,posId,liquidateAmount) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1472 | 1479 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1473 | 1480 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1474 | - | let $ | |
1475 | - | let AId = $ | |
1476 | - | let BId = $ | |
1477 | - | let balA = $ | |
1478 | - | let balB = $ | |
1479 | - | let shareId = $ | |
1481 | + | let $t04587745967 = getPoolData(Address(fromBase58String(pool)), pType) | |
1482 | + | let AId = $t04587745967._1 | |
1483 | + | let BId = $t04587745967._2 | |
1484 | + | let balA = $t04587745967._3 | |
1485 | + | let balB = $t04587745967._4 | |
1486 | + | let shareId = $t04587745967._5 | |
1480 | 1487 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1481 | 1488 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1482 | 1489 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1508 | 1515 | func capitalizeEx (pool,route,tokenToId,amountToExchange,claim) = valueOrElse(isActive(), valueOrElse(isOperatorCall(i), { | |
1509 | 1516 | let pType = getStringValue(this, (kPool + pool)) | |
1510 | 1517 | let change = valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0) | |
1511 | - | let $ | |
1512 | - | if (($ | |
1518 | + | let $t04793748039 = claimAndCheckAmnt(pool, pType, claim, amountToExchange, change) | |
1519 | + | if (($t04793748039 == $t04793748039)) | |
1513 | 1520 | then { | |
1514 | - | let claimedAsset = $ | |
1515 | - | let claimedAmount = $ | |
1521 | + | let claimedAsset = $t04793748039._2 | |
1522 | + | let claimedAmount = $t04793748039._1 | |
1516 | 1523 | let rArgs = split(route, "__") | |
1517 | 1524 | let exchangedAmount = if ((rArgs[0] == "directSwopfiCPMM")) | |
1518 | 1525 | then directSwopfiCPMM(rArgs, tokenToId) | |
1537 | 1544 | @Callable(i) | |
1538 | 1545 | func capitalizeNoEx (pool,claim,amountFromBalance) = valueOrElse(isActive(), valueOrElse(isOperatorCall(i), { | |
1539 | 1546 | let pType = getStringValue(this, (kPool + pool)) | |
1540 | - | let $ | |
1541 | - | if (($ | |
1547 | + | let $t04872348821 = claimAndCheckAmnt(pool, pType, claim, amountFromBalance, 0) | |
1548 | + | if (($t04872348821 == $t04872348821)) | |
1542 | 1549 | then { | |
1543 | - | let claimedAsset = $ | |
1544 | - | let claimedAmount = $ | |
1550 | + | let claimedAsset = $t04872348821._2 | |
1551 | + | let claimedAmount = $t04872348821._1 | |
1545 | 1552 | capitalize(pool, pType, assetIdToStr(claimedAsset), (claimedAmount + amountFromBalance)) | |
1546 | 1553 | } | |
1547 | 1554 | else throw("Strict value is not equal to itself.") | |
1559 | 1566 | else false) | |
1560 | 1567 | then throw("Wrong pool type") | |
1561 | 1568 | else { | |
1562 | - | let $ | |
1563 | - | let aId = $ | |
1564 | - | let bId = $ | |
1565 | - | let aBal = $ | |
1566 | - | let bBal = $ | |
1567 | - | let shareId = $ | |
1569 | + | let $t04934249436 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1570 | + | let aId = $t04934249436._1 | |
1571 | + | let bId = $t04934249436._2 | |
1572 | + | let aBal = $t04934249436._3 | |
1573 | + | let bBal = $t04934249436._4 | |
1574 | + | let shareId = $t04934249436._5 | |
1568 | 1575 | if ((0 > inFeeNoLoan)) | |
1569 | 1576 | then throw("inFeeNoLoan must be greater than 0") | |
1570 | 1577 | else if ((0 > inFeeLoan)) | |
1577 | 1584 | then throw("stoplossFeeNoLoan must be greater than 0") | |
1578 | 1585 | else if ((0 > stoplossFeeWithLoan)) | |
1579 | 1586 | then throw("stoplossFeeWithLoan must be greater than 0") | |
1580 | - | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kAxlyStopLossNoLoanFee), stoplossFeeNoLoan), IntegerEntry((poolAddr + kAxlyStopLossLoanFee), stoplossFeeWithLoan), IntegerEntry((poolAddr + kPoolInterestLoan), 0), IntegerEntry((poolAddr + kPoolInterestNoLoan), 0), StringEntry((kPool + poolAddr), type), StringEntry((shareId + kSharePool), poolAddr), BooleanEntry((poolAddr + kPoolCanBorrow), canBorrow)] | |
1587 | + | else [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((poolAddr + kPoolType), poolType), StringEntry((shareId + kSharePool), poolAddr), BooleanEntry((poolAddr + kPoolCanBorrow), canBorrow)] | |
1581 | 1588 | })) | |
1582 | 1589 | ||
1583 | 1590 |
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 CPMM = "cpmm" | |
9 | 9 | ||
10 | 10 | let FLAT = "flat" | |
11 | 11 | ||
12 | 12 | let CAP_FEE_NO_LOAN = "capNoLoan" | |
13 | 13 | ||
14 | 14 | let CAP_FEE_LOAN = "capLoan" | |
15 | 15 | ||
16 | 16 | let STOPLOSS_FEE_NO_LOAN = "stopLossNoLoan" | |
17 | 17 | ||
18 | 18 | let STOPLOSS_LOAN = "stopLossLoan" | |
19 | 19 | ||
20 | 20 | let LOAN_FEE = "loan" | |
21 | 21 | ||
22 | 22 | let NO_LOAN_FEE = "noLoan" | |
23 | 23 | ||
24 | 24 | let NO_FEE = "noFee" | |
25 | 25 | ||
26 | 26 | let SCALE8 = 100000000 | |
27 | 27 | ||
28 | 28 | let SCALE10 = 10000000000 | |
29 | 29 | ||
30 | 30 | let SCALE16 = toBigInt(10000000000000000) | |
31 | 31 | ||
32 | 32 | let FEE_SCALE6 = 1000000 | |
33 | 33 | ||
34 | 34 | let kSFPoolAAssetBalance = "A_asset_balance" | |
35 | 35 | ||
36 | 36 | let kSFPoolBAssetBalance = "B_asset_balance" | |
37 | 37 | ||
38 | 38 | let kSFPoolAAssetId = "A_asset_id" | |
39 | 39 | ||
40 | 40 | let kSFPoolBAssetId = "B_asset_id" | |
41 | 41 | ||
42 | 42 | let kSFPoolShareId = "share_asset_id" | |
43 | 43 | ||
44 | 44 | let kSFPoolShareSupply = "share_asset_supply" | |
45 | 45 | ||
46 | 46 | let kSFPoolFee = "commission" | |
47 | 47 | ||
48 | 48 | let kUserPosition = "_userPosition" | |
49 | 49 | ||
50 | 50 | let kUserPositionPool = "_userPositionPool" | |
51 | 51 | ||
52 | 52 | let kUserBorrowAmount = "_userPositionBorrowAmount" | |
53 | 53 | ||
54 | 54 | let kUserBorrowAssetId = "_userPositionBorrowAssetId" | |
55 | 55 | ||
56 | 56 | let kUserPositionNum = "_userPositionNumber" | |
57 | 57 | ||
58 | 58 | let kUserPositionInterest = "_userPositionInterest" | |
59 | 59 | ||
60 | 60 | let kPoolTotal = "_poolTotal" | |
61 | 61 | ||
62 | 62 | let kPoolTotalLoan = "_poolTotalLoan" | |
63 | 63 | ||
64 | 64 | let kPoolInterestLoan = "_poolInterestLoan" | |
65 | 65 | ||
66 | 66 | let kPoolInterestNoLoan = "_poolInterestNoLoan" | |
67 | 67 | ||
68 | 68 | let kPoolCanBorrow = "_poolCanBorrow" | |
69 | 69 | ||
70 | 70 | let kAxlyInFeeWithoutLoan = "_axlyFeeNoLoan" | |
71 | 71 | ||
72 | 72 | let kAxlyInFeeWithLoan = "_axlyFeeWithLoan" | |
73 | 73 | ||
74 | 74 | let kAxlyNoLoanCapFee = "_axlyFeeCapNoLoan" | |
75 | 75 | ||
76 | 76 | let kAxlyWithLoanCapFee = "_axlyFeeCapWithLoan" | |
77 | 77 | ||
78 | 78 | let kAxlyStopLossNoLoanFee = "_axlyFeeStoplossWithLoan" | |
79 | 79 | ||
80 | 80 | let kAxlyStopLossLoanFee = "_axlyFeeStoplossNoLoan" | |
81 | 81 | ||
82 | 82 | let kRequestId = "_request_id" | |
83 | 83 | ||
84 | 84 | let kRequestIter = "requests_iter" | |
85 | 85 | ||
86 | 86 | let kPool = "pool_" | |
87 | + | ||
88 | + | let kPoolType = "_poolType" | |
87 | 89 | ||
88 | 90 | let kSharePool = "_poolShareId" | |
89 | 91 | ||
90 | 92 | let kPoolCapChange = "_poolCapChange" | |
91 | 93 | ||
92 | 94 | let kTokenLastPrice = "last_price" | |
93 | 95 | ||
94 | 96 | let kPriceInOracle = "_twap5B" | |
95 | 97 | ||
96 | 98 | let kActive = "active" | |
97 | 99 | ||
98 | 100 | let kActiveUsers = "activeUsers" | |
99 | 101 | ||
100 | 102 | let kActiveSFWX = "_active" | |
101 | 103 | ||
102 | 104 | let kPoolActive = "_activePool" | |
103 | 105 | ||
104 | 106 | let kUserStopLoss = "_stopLoss" | |
105 | 107 | ||
106 | 108 | let kFallbackExchangeSwopfi = "_fallbackExchangeSwopfi" | |
107 | 109 | ||
108 | 110 | let kMoneyBox = "axly_money_box" | |
109 | 111 | ||
110 | 112 | let kSFFarmingAddr = "swopfi_farming_addr" | |
111 | 113 | ||
112 | 114 | let kLendService = "lend_service_addr" | |
113 | 115 | ||
114 | 116 | let kOperatorCallPK = "admin_call_pub_key" | |
115 | 117 | ||
116 | 118 | let kPriceOracle = "price_oracle" | |
117 | 119 | ||
118 | 120 | let kExContract = "exchange_contract" | |
119 | 121 | ||
120 | 122 | let kWxSwapContract = "wx_swap_contract" | |
121 | 123 | ||
122 | 124 | let kSwopId = "swop_id" | |
123 | 125 | ||
124 | 126 | let kWxId = "wx_id" | |
125 | 127 | ||
126 | 128 | let kGroup1Admin1PK = "group1_admin1_pub_key" | |
127 | 129 | ||
128 | 130 | let kGroup1Admin2PK = "group1_admin2_pub_key" | |
129 | 131 | ||
130 | 132 | let kGroup2Admin1PK = "group2_admin1_pub_key" | |
131 | 133 | ||
132 | 134 | let kGroup2Admin2PK = "group2_admin2_pub_key" | |
133 | 135 | ||
134 | 136 | let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address"))) | |
135 | 137 | ||
136 | 138 | let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address"))) | |
137 | 139 | ||
138 | 140 | let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address"))) | |
139 | 141 | ||
140 | 142 | let wxSwapContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kWxSwapContract), "No wx swap address"))) | |
141 | 143 | ||
142 | 144 | let SWOPID = fromBase58String(valueOrErrorMessage(getString(this, kSwopId), "No swop id")) | |
143 | 145 | ||
144 | 146 | let WXID = fromBase58String(valueOrErrorMessage(getString(this, kWxId), "No wx id")) | |
145 | 147 | ||
146 | 148 | let group1Admin1PK = fromBase58String(valueOrErrorMessage(getString(this, kGroup1Admin1PK), "Can't get kGroup1Admin1PK")) | |
147 | 149 | ||
148 | 150 | let group1Admin2PK = fromBase58String(valueOrErrorMessage(getString(this, kGroup1Admin2PK), "Can't get kGroup1Admin2PK")) | |
149 | 151 | ||
150 | 152 | let group2Admin1PK = fromBase58String(valueOrErrorMessage(getString(this, kGroup2Admin1PK), "Can't get kGroup2Admin1PK")) | |
151 | 153 | ||
152 | 154 | let group2Admin2PK = fromBase58String(valueOrErrorMessage(getString(this, kGroup2Admin2PK), "Can't get kGroup2Admin1PK")) | |
153 | 155 | ||
154 | 156 | let operatorPK = fromBase58String(valueOrErrorMessage(getString(this, kOperatorCallPK), "Can't get operatorPK")) | |
155 | 157 | ||
156 | 158 | func unknownPoolType () = throw("Wrong pool type") | |
157 | 159 | ||
158 | 160 | ||
159 | 161 | func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr"))) | |
160 | 162 | ||
161 | 163 | ||
162 | 164 | func isOperatorCall (i) = if ((i.callerPublicKey == operatorPK)) | |
163 | 165 | then unit | |
164 | 166 | else throw("Only operator can call this function") | |
165 | 167 | ||
166 | 168 | ||
167 | 169 | func isAdminCall (i) = if (if ((i.callerPublicKey == group1Admin1PK)) | |
168 | 170 | then true | |
169 | 171 | else (i.callerPublicKey == group1Admin2PK)) | |
170 | 172 | then unit | |
171 | 173 | else throw("Only admin group1 can call this function") | |
172 | 174 | ||
173 | 175 | ||
174 | 176 | func isSelfCall (i) = if ((i.caller == this)) | |
175 | 177 | then unit | |
176 | 178 | else throw("Only contract itself can call this function") | |
177 | 179 | ||
178 | 180 | ||
179 | 181 | func isLandCall (i) = if ((i.caller == getLendSrvAddr())) | |
180 | 182 | then unit | |
181 | 183 | else throw("Only land contract can call this function") | |
182 | 184 | ||
183 | 185 | ||
184 | 186 | func isActive () = if ((valueOrElse(getBoolean(this, kActive), true) == true)) | |
185 | 187 | then unit | |
186 | 188 | else throw("DApp is inactive at this moment") | |
187 | 189 | ||
188 | 190 | ||
189 | 191 | func isActiveForUsers () = if (if (valueOrElse(getBoolean(this, kActive), true)) | |
190 | 192 | then (valueOrElse(getBoolean(this, kActiveUsers), true) == true) | |
191 | 193 | else false) | |
192 | 194 | then unit | |
193 | 195 | else throw("DApp is inactive for users at this moment") | |
194 | 196 | ||
195 | 197 | ||
196 | 198 | func isPoolActive (pool,type) = { | |
197 | 199 | let WXSFActive = valueOrElse(getBoolean(this, (type + kActiveSFWX)), true) | |
198 | 200 | let poolActive = valueOrElse(getBoolean(this, (pool + kPoolActive)), true) | |
199 | 201 | if (if (WXSFActive) | |
200 | 202 | then poolActive | |
201 | 203 | else false) | |
202 | 204 | then true | |
203 | 205 | else false | |
204 | 206 | } | |
205 | 207 | ||
206 | 208 | ||
207 | 209 | func accountBalance (assetId) = match assetId { | |
208 | 210 | case id: ByteVector => | |
209 | 211 | assetBalance(this, id) | |
210 | 212 | case waves: Unit => | |
211 | 213 | wavesBalance(this).available | |
212 | 214 | case _ => | |
213 | 215 | throw("Match error") | |
214 | 216 | } | |
215 | 217 | ||
216 | 218 | ||
217 | 219 | func getSFPoolBalances (poolAddr) = $Tuple2(valueOrErrorMessage(getInteger(poolAddr, kSFPoolAAssetBalance), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolBAssetBalance), "Can't get pool B asset balance")) | |
218 | 220 | ||
219 | 221 | ||
220 | 222 | func getWXPoolBalances (poolAddr,aId,bId) = $Tuple2({ | |
221 | 223 | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [aId], nil) | |
222 | 224 | if ($isInstanceOf(@, "Int")) | |
223 | 225 | then @ | |
224 | 226 | else throw(($getType(@) + " couldn't be cast to Int")) | |
225 | 227 | }, { | |
226 | 228 | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [bId], nil) | |
227 | 229 | if ($isInstanceOf(@, "Int")) | |
228 | 230 | then @ | |
229 | 231 | else throw(($getType(@) + " couldn't be cast to Int")) | |
230 | 232 | }) | |
231 | 233 | ||
232 | 234 | ||
233 | 235 | func getPoolBalances (poolAddr,type,aId,bId) = if ((type == SF_POOL)) | |
234 | 236 | then getSFPoolBalances(poolAddr) | |
235 | 237 | else if ((type == WX_POOL)) | |
236 | 238 | then getWXPoolBalances(poolAddr, aId, bId) | |
237 | 239 | else unknownPoolType() | |
238 | 240 | ||
239 | 241 | ||
240 | 242 | func getSFPoolData (poolAddr) = { | |
241 | - | let $ | |
242 | - | if (($ | |
243 | + | let $t080898138 = getSFPoolBalances(poolAddr) | |
244 | + | if (($t080898138 == $t080898138)) | |
243 | 245 | then { | |
244 | - | let balB = $ | |
245 | - | let balA = $ | |
246 | + | let balB = $t080898138._2 | |
247 | + | let balA = $t080898138._1 | |
246 | 248 | $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), balA, balB, valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id")) | |
247 | 249 | } | |
248 | 250 | else throw("Strict value is not equal to itself.") | |
249 | 251 | } | |
250 | 252 | ||
251 | 253 | ||
252 | 254 | func getWXPoolData (poolAddr) = { | |
253 | 255 | let cfg = { | |
254 | 256 | let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil) | |
255 | 257 | if ($isInstanceOf(@, "List[Any]")) | |
256 | 258 | then @ | |
257 | 259 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
258 | 260 | } | |
259 | 261 | if ((cfg == cfg)) | |
260 | 262 | then { | |
261 | 263 | let aId = valueOrErrorMessage({ | |
262 | 264 | let @ = cfg[4] | |
263 | 265 | if ($isInstanceOf(@, "String")) | |
264 | 266 | then @ | |
265 | 267 | else unit | |
266 | 268 | }, "Can't get pool A asset id") | |
267 | 269 | let bId = valueOrErrorMessage({ | |
268 | 270 | let @ = cfg[5] | |
269 | 271 | if ($isInstanceOf(@, "String")) | |
270 | 272 | then @ | |
271 | 273 | else unit | |
272 | 274 | }, "Can't get pool B asset id") | |
273 | 275 | let shareId = valueOrErrorMessage({ | |
274 | 276 | let @ = cfg[3] | |
275 | 277 | if ($isInstanceOf(@, "String")) | |
276 | 278 | then @ | |
277 | 279 | else unit | |
278 | 280 | }, "Can't get pool LP asset id") | |
279 | - | let $ | |
280 | - | if (($ | |
281 | + | let $t088358894 = getWXPoolBalances(poolAddr, aId, bId) | |
282 | + | if (($t088358894 == $t088358894)) | |
281 | 283 | then { | |
282 | - | let balB = $ | |
283 | - | let balA = $ | |
284 | + | let balB = $t088358894._2 | |
285 | + | let balA = $t088358894._1 | |
284 | 286 | $Tuple5(aId, bId, balA, balB, shareId) | |
285 | 287 | } | |
286 | 288 | else throw("Strict value is not equal to itself.") | |
287 | 289 | } | |
288 | 290 | else throw("Strict value is not equal to itself.") | |
289 | 291 | } | |
290 | 292 | ||
291 | 293 | ||
292 | 294 | func getPoolData (poolAddr,type) = if ((type == SF_POOL)) | |
293 | 295 | then getSFPoolData(poolAddr) | |
294 | 296 | else if ((type == WX_POOL)) | |
295 | 297 | then getWXPoolData(poolAddr) | |
296 | 298 | else unknownPoolType() | |
297 | 299 | ||
298 | 300 | ||
299 | 301 | func getShareSupply (poolAddr,type,shareId) = if ((type == SF_POOL)) | |
300 | 302 | then valueOrErrorMessage(getInteger(poolAddr, kSFPoolShareSupply), "Can't get share asset supply") | |
301 | 303 | else if ((type == WX_POOL)) | |
302 | 304 | then valueOrErrorMessage(assetInfo(fromBase58String(shareId)), "Wrong ShareId").quantity | |
303 | 305 | else unknownPoolType() | |
304 | 306 | ||
305 | 307 | ||
306 | 308 | func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0) | |
307 | 309 | ||
308 | 310 | ||
309 | 311 | func getPoolTotalShareWithLoan (pool) = valueOrElse(getInteger(this, (pool + kPoolTotalLoan)), 0) | |
310 | 312 | ||
311 | 313 | ||
312 | 314 | func getNewUserPositionNumber (user) = (valueOrElse(getInteger(this, (user + kUserPositionNum)), 0) + 1) | |
313 | 315 | ||
314 | 316 | ||
315 | 317 | func getAxlyFee (pool,feeType) = if ((feeType == CAP_FEE_LOAN)) | |
316 | 318 | then getIntegerValue(this, (pool + kAxlyWithLoanCapFee)) | |
317 | 319 | else if ((feeType == CAP_FEE_NO_LOAN)) | |
318 | 320 | then getIntegerValue(this, (pool + kAxlyNoLoanCapFee)) | |
319 | 321 | else if ((feeType == LOAN_FEE)) | |
320 | 322 | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
321 | 323 | else if ((feeType == NO_LOAN_FEE)) | |
322 | 324 | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
323 | 325 | else if ((feeType == NO_FEE)) | |
324 | 326 | then 0 | |
325 | 327 | else throw("Wrong fee type") | |
326 | 328 | ||
327 | 329 | ||
328 | 330 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
329 | 331 | ||
330 | 332 | ||
331 | 333 | func getWXFarmingAddr (poolAddr) = { | |
332 | 334 | let fContract = Address(fromBase58String(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
333 | 335 | let factroyCfg = split(valueOrErrorMessage(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
334 | 336 | Address(fromBase58String(factroyCfg[1])) | |
335 | 337 | } | |
336 | 338 | ||
337 | 339 | ||
338 | 340 | func assetIdToStr (assetId) = match assetId { | |
339 | 341 | case id: ByteVector => | |
340 | 342 | toBase58String(id) | |
341 | 343 | case waves: Unit => | |
342 | 344 | "WAVES" | |
343 | 345 | case _ => | |
344 | 346 | throw("Not Asset id") | |
345 | 347 | } | |
346 | 348 | ||
347 | 349 | ||
348 | 350 | func assetIdFromStr (assetId) = if ((assetId == "WAVES")) | |
349 | 351 | then unit | |
350 | 352 | else fromBase58String(assetId) | |
351 | 353 | ||
352 | 354 | ||
353 | 355 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
354 | 356 | then 8 | |
355 | 357 | else match assetInfo(fromBase58String(assetId)) { | |
356 | 358 | case asset: Asset => | |
357 | 359 | asset.decimals | |
358 | 360 | case _ => | |
359 | 361 | throw("Can't find asset") | |
360 | 362 | } | |
361 | 363 | ||
362 | 364 | ||
363 | 365 | func getAssetPrecition (assetId) = pow(10, 0, getAssetDecimals(assetId), 0, 0, DOWN) | |
364 | 366 | ||
365 | 367 | ||
366 | 368 | func getAssetsPrice (assetIds) = { | |
367 | 369 | func getPrices (a,assetId) = { | |
368 | 370 | let assetPrice = valueOrElse(getInteger(priceOracleAddr, (assetId + kPriceInOracle)), -1) | |
369 | 371 | (a :+ assetPrice) | |
370 | 372 | } | |
371 | 373 | ||
372 | 374 | let $l = assetIds | |
373 | 375 | let $s = size($l) | |
374 | 376 | let $acc0 = nil | |
375 | 377 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
376 | 378 | then $a | |
377 | 379 | else getPrices($a, $l[$i]) | |
378 | 380 | ||
379 | 381 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
380 | 382 | then $a | |
381 | 383 | else throw("List size exceeds 50") | |
382 | 384 | ||
383 | 385 | $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) | |
384 | 386 | } | |
385 | 387 | ||
386 | 388 | ||
387 | 389 | func getSharePrice (shareId) = { | |
388 | 390 | let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id") | |
389 | 391 | let poolAddr = Address(fromBase58String(pool)) | |
390 | 392 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
391 | - | let $ | |
392 | - | let aId = $ | |
393 | - | let bId = $ | |
394 | - | let aBalance = $ | |
395 | - | let bBalance = $ | |
393 | + | let $t01188311948 = getPoolData(poolAddr, pType) | |
394 | + | let aId = $t01188311948._1 | |
395 | + | let bId = $t01188311948._2 | |
396 | + | let aBalance = $t01188311948._3 | |
397 | + | let bBalance = $t01188311948._4 | |
396 | 398 | let prices = getAssetsPrice([aId, bId]) | |
397 | 399 | let dPriceA = prices[0] | |
398 | 400 | let dPriceB = prices[1] | |
399 | 401 | if (if ((0 > dPriceA)) | |
400 | 402 | then true | |
401 | 403 | else (0 > dPriceB)) | |
402 | 404 | then -1 | |
403 | 405 | else { | |
404 | 406 | let shareSupply = getShareSupply(poolAddr, pType, shareId) | |
405 | 407 | let APrecision = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
406 | 408 | let BPrecision = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
407 | 409 | let sharePrecision = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN) | |
408 | 410 | let sum = (fraction(aBalance, dPriceA, APrecision) + fraction(bBalance, dPriceB, BPrecision)) | |
409 | 411 | fraction(sum, sharePrecision, shareSupply) | |
410 | 412 | } | |
411 | 413 | } | |
412 | 414 | ||
413 | 415 | ||
414 | 416 | func getSharePrices (shareIds) = { | |
415 | 417 | func getPrices (a,shareId) = (a :+ getSharePrice(shareId)) | |
416 | 418 | ||
417 | 419 | let $l = shareIds | |
418 | 420 | let $s = size($l) | |
419 | 421 | let $acc0 = nil | |
420 | 422 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
421 | 423 | then $a | |
422 | 424 | else getPrices($a, $l[$i]) | |
423 | 425 | ||
424 | 426 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
425 | 427 | then $a | |
426 | 428 | else throw("List size exceeds 20") | |
427 | 429 | ||
428 | 430 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
429 | 431 | } | |
430 | 432 | ||
431 | 433 | ||
432 | 434 | func getCursEntries (aId,bId,shareId,wAmounts) = { | |
433 | 435 | let assetsPrices = getAssetsPrice([aId, bId]) | |
434 | 436 | let sharePrice = getSharePrice(shareId) | |
435 | 437 | let prices = ([toString(assetsPrices[0]), toString(assetsPrices[1]), toString(sharePrice)] ++ wAmounts) | |
436 | 438 | [StringEntry(kTokenLastPrice, makeString(prices, ","))] | |
437 | 439 | } | |
438 | 440 | ||
439 | 441 | ||
440 | 442 | func calcReplenishByTwoTokens (pType,poolAddr,pmtA,aId,pmtB,bId,balA,balB) = if ((pType == SF_POOL)) | |
441 | 443 | then { | |
442 | 444 | let repl = { | |
443 | 445 | let @ = invoke(poolAddr, "callFunction", ["calcLPReplenishTwoTokensREADONLY", [toString(pmtA), toString(pmtB)]], nil) | |
444 | 446 | if ($isInstanceOf(@, "List[Any]")) | |
445 | 447 | then @ | |
446 | 448 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
447 | 449 | } | |
448 | 450 | if ((repl == repl)) | |
449 | 451 | then $Tuple5({ | |
450 | 452 | let @ = repl[3] | |
451 | 453 | if ($isInstanceOf(@, "Int")) | |
452 | 454 | then @ | |
453 | 455 | else throw(($getType(@) + " couldn't be cast to Int")) | |
454 | 456 | }, { | |
455 | 457 | let @ = repl[4] | |
456 | 458 | if ($isInstanceOf(@, "Int")) | |
457 | 459 | then @ | |
458 | 460 | else throw(($getType(@) + " couldn't be cast to Int")) | |
459 | 461 | }, { | |
460 | 462 | let @ = repl[1] | |
461 | 463 | if ($isInstanceOf(@, "Int")) | |
462 | 464 | then @ | |
463 | 465 | else throw(($getType(@) + " couldn't be cast to Int")) | |
464 | 466 | }, assetIdToStr(repl[2]), { | |
465 | 467 | let @ = repl[0] | |
466 | 468 | if ($isInstanceOf(@, "Int")) | |
467 | 469 | then @ | |
468 | 470 | else throw(($getType(@) + " couldn't be cast to Int")) | |
469 | 471 | }) | |
470 | 472 | else throw("Strict value is not equal to itself.") | |
471 | 473 | } | |
472 | 474 | else if ((pType == WX_POOL)) | |
473 | 475 | then { | |
474 | - | let $ | |
476 | + | let $t01349213742 = $Tuple2(split({ | |
475 | 477 | let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil) | |
476 | 478 | if ($isInstanceOf(@, "String")) | |
477 | 479 | then @ | |
478 | 480 | else throw(($getType(@) + " couldn't be cast to String")) | |
479 | 481 | }, "__"), split({ | |
480 | 482 | let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil) | |
481 | 483 | if ($isInstanceOf(@, "String")) | |
482 | 484 | then @ | |
483 | 485 | else throw(($getType(@) + " couldn't be cast to String")) | |
484 | 486 | }, "__")) | |
485 | - | if (($ | |
487 | + | if (($t01349213742 == $t01349213742)) | |
486 | 488 | then { | |
487 | - | let evalPutInB = $ | |
488 | - | let evalPutInA = $ | |
489 | + | let evalPutInB = $t01349213742._2 | |
490 | + | let evalPutInA = $t01349213742._1 | |
489 | 491 | let lpInA = parseIntValue(evalPutInA[1]) | |
490 | 492 | let lpInB = parseIntValue(evalPutInB[1]) | |
491 | 493 | if ((lpInB > lpInA)) | |
492 | 494 | then { | |
493 | 495 | let pmt = parseIntValue(evalPutInA[8]) | |
494 | 496 | $Tuple5(pmtA, pmt, (pmtB - pmt), bId, lpInB) | |
495 | 497 | } | |
496 | 498 | else { | |
497 | 499 | let pmt = parseIntValue(evalPutInB[7]) | |
498 | 500 | $Tuple5(pmt, pmtB, (pmtA - pmt), aId, lpInA) | |
499 | 501 | } | |
500 | 502 | } | |
501 | 503 | else throw("Strict value is not equal to itself.") | |
502 | 504 | } | |
503 | 505 | else unknownPoolType() | |
504 | 506 | ||
505 | 507 | ||
506 | 508 | func replenishTwoTokensByType (poolAddr,pType,pmtA,aId,pmtB,bId) = { | |
507 | 509 | let payments = [AttachedPayment(assetIdFromStr(aId), pmtA), AttachedPayment(assetIdFromStr(bId), pmtB)] | |
508 | 510 | if ((pType == SF_POOL)) | |
509 | 511 | then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
510 | 512 | else if ((pType == WX_POOL)) | |
511 | 513 | then invoke(poolAddr, "put", [1000000, false], payments) | |
512 | 514 | else unknownPoolType() | |
513 | 515 | } | |
514 | 516 | ||
515 | 517 | ||
516 | 518 | func replenishOneTokenByType (poolAddr,pType,pmt,pmtId) = { | |
517 | 519 | let payments = [AttachedPayment(assetIdFromStr(pmtId), pmt)] | |
518 | 520 | if ((pType == SF_POOL)) | |
519 | 521 | then invoke(poolAddr, "callFunction", ["replenishWithOneToken", ["0", "false", "0"]], payments) | |
520 | 522 | else if ((pType == WX_POOL)) | |
521 | - | then invoke(poolAddr, "putOneTkn", [0, false], payments) | |
523 | + | then { | |
524 | + | let fc = if ((valueOrElse(getString(this, (toString(poolAddr) + kPoolType)), "cpmm") == FLAT)) | |
525 | + | then "putOneTknV2" | |
526 | + | else "putOneTkn" | |
527 | + | invoke(poolAddr, fc, [0, false], payments) | |
528 | + | } | |
522 | 529 | else unknownPoolType() | |
523 | 530 | } | |
524 | 531 | ||
525 | 532 | ||
526 | 533 | func stakeLP (pool,pType,shareId,amount) = { | |
527 | 534 | let payments = [AttachedPayment(fromBase58String(shareId), amount)] | |
528 | 535 | if ((pType == SF_POOL)) | |
529 | 536 | then invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], payments) | |
530 | 537 | else if ((pType == WX_POOL)) | |
531 | 538 | then invoke(getWXFarmingAddr(addressFromStringValue(pool)), "stake", nil, payments) | |
532 | 539 | else unknownPoolType() | |
533 | 540 | } | |
534 | 541 | ||
535 | 542 | ||
536 | 543 | func unstakeLP (pool,pType,shareId,amount) = { | |
537 | - | let $ | |
544 | + | let $t01552015870 = if ((pType == SF_POOL)) | |
538 | 545 | then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount]) | |
539 | 546 | else if ((pType == WX_POOL)) | |
540 | 547 | then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount]) | |
541 | 548 | else unknownPoolType() | |
542 | - | let farmAddr = $ | |
543 | - | let fName = $ | |
544 | - | let params = $ | |
549 | + | let farmAddr = $t01552015870._1 | |
550 | + | let fName = $t01552015870._2 | |
551 | + | let params = $t01552015870._3 | |
545 | 552 | let inv = invoke(farmAddr, fName, params, nil) | |
546 | 553 | if ((inv == inv)) | |
547 | 554 | then amount | |
548 | 555 | else throw("Strict value is not equal to itself.") | |
549 | 556 | } | |
550 | 557 | ||
551 | 558 | ||
552 | 559 | func calcAmountToPaySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
553 | 560 | let poolAddr = Address(fromBase58String(pool)) | |
554 | 561 | let feeScale6 = 1000000 | |
555 | 562 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
556 | 563 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee), CEILING) | |
557 | - | let $ | |
564 | + | let $t01629216598 = if ((assetTokenToGet == assetIdA)) | |
558 | 565 | then { | |
559 | 566 | let amountToPay = fraction(amntGetNoFee, balB, (balA - amntGetNoFee), CEILING) | |
560 | 567 | $Tuple2(amountToPay, assetIdB) | |
561 | 568 | } | |
562 | 569 | else { | |
563 | 570 | let amountToPay = fraction(amntGetNoFee, balA, (balB - amntGetNoFee), CEILING) | |
564 | 571 | $Tuple2(amountToPay, assetIdA) | |
565 | 572 | } | |
566 | - | let amountToPay = $ | |
567 | - | let assetToPay = $ | |
573 | + | let amountToPay = $t01629216598._1 | |
574 | + | let assetToPay = $t01629216598._2 | |
568 | 575 | $Tuple2(assetToPay, amountToPay) | |
569 | 576 | } | |
570 | 577 | ||
571 | 578 | ||
572 | 579 | func getWXSwapFees (pool) = { | |
573 | 580 | let poolAddr = addressFromStringValue(pool) | |
574 | 581 | let fContract = addressFromStringValue(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr")) | |
575 | 582 | let poolFeeDefault = value(getInteger(wxSwapContract, "%s__poolFee")) | |
576 | 583 | let protocolFeeDefault = value(getInteger(wxSwapContract, "%s__protocolFee")) | |
577 | 584 | match invoke(fContract, "getSwapFeeREADONLY", [toString(poolAddr)], nil) { | |
578 | 585 | case fees: (Int, Int) => | |
579 | 586 | $Tuple2(fees._1, fees._2) | |
580 | 587 | case _ => | |
581 | 588 | $Tuple2(poolFeeDefault, protocolFeeDefault) | |
582 | 589 | } | |
583 | 590 | } | |
584 | 591 | ||
585 | 592 | ||
586 | 593 | func calcAmountToPayWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
587 | - | let $ | |
588 | - | let pFee = $ | |
589 | - | let prFee = $ | |
594 | + | let $t01733817377 = getWXSwapFees(pool) | |
595 | + | let pFee = $t01733817377._1 | |
596 | + | let prFee = $t01733817377._2 | |
590 | 597 | let feeScale = toBigInt(100000000) | |
591 | - | let $ | |
598 | + | let $t01741717725 = if ((assetTokenToGet == assetIdA)) | |
592 | 599 | then { | |
593 | 600 | let amountToPay = fraction(amountTokenToGet, balB, (balA - amountTokenToGet)) | |
594 | 601 | $Tuple2(amountToPay, assetIdB) | |
595 | 602 | } | |
596 | 603 | else { | |
597 | 604 | let amountToPay = fraction(amountTokenToGet, balA, (balB - amountTokenToGet)) | |
598 | 605 | $Tuple2(amountToPay, assetIdA) | |
599 | 606 | } | |
600 | - | let amountToPay = $ | |
601 | - | let assetToPay = $ | |
607 | + | let amountToPay = $t01741717725._1 | |
608 | + | let assetToPay = $t01741717725._2 | |
602 | 609 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))), CEILING)) | |
603 | 610 | $Tuple2(assetToPay, amountToPayWithFee) | |
604 | 611 | } | |
605 | 612 | ||
606 | 613 | ||
607 | 614 | func exchangeDirectly (pType,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
608 | 615 | let poolFB = valueOrElse(getString(this, (pool + kFallbackExchangeSwopfi)), "") | |
609 | 616 | if (if ((pType == SF_POOL)) | |
610 | 617 | then true | |
611 | 618 | else (poolFB != "")) | |
612 | 619 | then { | |
613 | - | let $ | |
620 | + | let $t01816618378 = if ((poolFB == "")) | |
614 | 621 | then $Tuple3(balA, balB, pool) | |
615 | 622 | else { | |
616 | - | let $ | |
617 | - | let sfBalA = $ | |
618 | - | let sfBalB = $ | |
623 | + | let $t01827218345 = getSFPoolBalances(addressFromStringValue(poolFB)) | |
624 | + | let sfBalA = $t01827218345._1 | |
625 | + | let sfBalB = $t01827218345._2 | |
619 | 626 | $Tuple3(sfBalA, sfBalB, poolFB) | |
620 | 627 | } | |
621 | - | let pBalA = $ | |
622 | - | let pBalB = $ | |
623 | - | let exPool = $ | |
624 | - | let $ | |
625 | - | let assetToPay = $ | |
626 | - | let amountToPay = $ | |
628 | + | let pBalA = $t01816618378._1 | |
629 | + | let pBalB = $t01816618378._2 | |
630 | + | let exPool = $t01816618378._3 | |
631 | + | let $t01838318509 = calcAmountToPaySF(exPool, assetIdA, assetIdB, pBalA, pBalB, amountTokenToGet, assetTokenToGet) | |
632 | + | let assetToPay = $t01838318509._1 | |
633 | + | let amountToPay = $t01838318509._2 | |
627 | 634 | invoke(addressFromStringValue(exPool), "callFunction", ["exchange", [toString(amountTokenToGet)]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
628 | 635 | } | |
629 | 636 | else if ((pType == WX_POOL)) | |
630 | 637 | then { | |
631 | - | let $ | |
632 | - | let assetToPay = $ | |
633 | - | let amountToPay = $ | |
638 | + | let $t01871118833 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
639 | + | let assetToPay = $t01871118833._1 | |
640 | + | let amountToPay = $t01871118833._2 | |
634 | 641 | invoke(wxSwapContract, "swap", [amountTokenToGet, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
635 | 642 | } | |
636 | 643 | else unknownPoolType() | |
637 | 644 | } | |
638 | 645 | ||
639 | 646 | ||
640 | 647 | func calcWithdrawLPFromPoolVirt (poolAddr,pType,shareId,userCanWithdraw) = { | |
641 | - | let $ | |
648 | + | let $t01912019584 = if ((pType == SF_POOL)) | |
642 | 649 | then { | |
643 | 650 | let inv = { | |
644 | 651 | let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(userCanWithdraw)]], nil) | |
645 | 652 | if ($isInstanceOf(@, "List[Any]")) | |
646 | 653 | then @ | |
647 | 654 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
648 | 655 | } | |
649 | 656 | if ((inv == inv)) | |
650 | 657 | then $Tuple2({ | |
651 | 658 | let @ = inv[0] | |
652 | 659 | if ($isInstanceOf(@, "Int")) | |
653 | 660 | then @ | |
654 | 661 | else throw(($getType(@) + " couldn't be cast to Int")) | |
655 | 662 | }, { | |
656 | 663 | let @ = inv[1] | |
657 | 664 | if ($isInstanceOf(@, "Int")) | |
658 | 665 | then @ | |
659 | 666 | else throw(($getType(@) + " couldn't be cast to Int")) | |
660 | 667 | }) | |
661 | 668 | else throw("Strict value is not equal to itself.") | |
662 | 669 | } | |
663 | 670 | else if ((pType == WX_POOL)) | |
664 | 671 | then { | |
665 | 672 | let inv = split({ | |
666 | 673 | let @ = invoke(poolAddr, "evaluateGetREADONLY", [shareId, userCanWithdraw], nil) | |
667 | 674 | if ($isInstanceOf(@, "String")) | |
668 | 675 | then @ | |
669 | 676 | else throw(($getType(@) + " couldn't be cast to String")) | |
670 | 677 | }, "__") | |
671 | 678 | if ((inv == inv)) | |
672 | 679 | then $Tuple2(parseIntValue(inv[1]), parseIntValue(inv[2])) | |
673 | 680 | else throw("Strict value is not equal to itself.") | |
674 | 681 | } | |
675 | 682 | else unknownPoolType() | |
676 | - | let amountA = $ | |
677 | - | let amountB = $ | |
683 | + | let amountA = $t01912019584._1 | |
684 | + | let amountB = $t01912019584._2 | |
678 | 685 | $Tuple2(amountA, amountB) | |
679 | 686 | } | |
680 | 687 | ||
681 | 688 | ||
682 | 689 | func claimFarmed (pType,pool) = if ((pType == SF_POOL)) | |
683 | 690 | then { | |
684 | 691 | let balBefore = accountBalance(SWOPID) | |
685 | 692 | if ((balBefore == balBefore)) | |
686 | 693 | then { | |
687 | 694 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
688 | 695 | if ((inv == inv)) | |
689 | 696 | then { | |
690 | 697 | let balAfter = accountBalance(SWOPID) | |
691 | 698 | $Tuple2((balAfter - balBefore), SWOPID) | |
692 | 699 | } | |
693 | 700 | else throw("Strict value is not equal to itself.") | |
694 | 701 | } | |
695 | 702 | else throw("Strict value is not equal to itself.") | |
696 | 703 | } | |
697 | 704 | else if ((pType == WX_POOL)) | |
698 | 705 | then { | |
699 | - | let $ | |
700 | - | let aId = $ | |
701 | - | let bId = $ | |
702 | - | let aBal = $ | |
703 | - | let bBal = $ | |
704 | - | let lpId = $ | |
706 | + | let $t01995220031 = getWXPoolData(addressFromStringValue(pool)) | |
707 | + | let aId = $t01995220031._1 | |
708 | + | let bId = $t01995220031._2 | |
709 | + | let aBal = $t01995220031._3 | |
710 | + | let bBal = $t01995220031._4 | |
711 | + | let lpId = $t01995220031._5 | |
705 | 712 | let balBefore = accountBalance(WXID) | |
706 | 713 | if ((balBefore == balBefore)) | |
707 | 714 | then { | |
708 | 715 | let inv = invoke(getWXFarmingAddr(addressFromStringValue(pool)), "claimWx", [lpId], nil) | |
709 | 716 | if ((inv == inv)) | |
710 | 717 | then { | |
711 | 718 | let balAfter = accountBalance(WXID) | |
712 | 719 | $Tuple2((balAfter - balBefore), WXID) | |
713 | 720 | } | |
714 | 721 | else throw("Strict value is not equal to itself.") | |
715 | 722 | } | |
716 | 723 | else throw("Strict value is not equal to itself.") | |
717 | 724 | } | |
718 | 725 | else unknownPoolType() | |
719 | 726 | ||
720 | 727 | ||
721 | 728 | func replenishByType (pType,pool,feeType,pmtA,aId,pmtB,bId,balA,balB,LPId) = { | |
722 | 729 | let lpBalanceBefore = accountBalance(fromBase58String(LPId)) | |
723 | 730 | if ((lpBalanceBefore == lpBalanceBefore)) | |
724 | 731 | then { | |
725 | 732 | let poolAddr = addressFromStringValue(pool) | |
726 | - | let $ | |
733 | + | let $t02062921045 = if (if ((pmtA > 0)) | |
727 | 734 | then (pmtB > 0) | |
728 | 735 | else false) | |
729 | 736 | then { | |
730 | - | let $ | |
731 | - | let pmtInA = $ | |
732 | - | let pmtInB = $ | |
733 | - | let change = $ | |
734 | - | let changeId = $ | |
737 | + | let $t02069520811 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB) | |
738 | + | let pmtInA = $t02069520811._1 | |
739 | + | let pmtInB = $t02069520811._2 | |
740 | + | let change = $t02069520811._3 | |
741 | + | let changeId = $t02069520811._4 | |
735 | 742 | let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId) | |
736 | 743 | if ((inv == inv)) | |
737 | 744 | then $Tuple2(change, changeId) | |
738 | 745 | else throw("Strict value is not equal to itself.") | |
739 | 746 | } | |
740 | 747 | else if ((pmtA > 0)) | |
741 | 748 | then $Tuple2(pmtA, aId) | |
742 | 749 | else if ((pmtB > 0)) | |
743 | 750 | then $Tuple2(pmtB, bId) | |
744 | 751 | else throw("pmts must be > 0") | |
745 | - | let change = $ | |
746 | - | let changeId = $ | |
752 | + | let change = $t02062921045._1 | |
753 | + | let changeId = $t02062921045._2 | |
747 | 754 | let inv = if ((change > 0)) | |
748 | 755 | then replenishOneTokenByType(poolAddr, pType, change, changeId) | |
749 | 756 | else nil | |
750 | 757 | if ((inv == inv)) | |
751 | 758 | then { | |
752 | 759 | let lpBalanceAfter = accountBalance(fromBase58String(LPId)) | |
753 | 760 | let totalStaked = (lpBalanceAfter - lpBalanceBefore) | |
754 | 761 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
755 | 762 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
756 | 763 | if ((0 >= userShareForStake)) | |
757 | 764 | then throw("amount of staked sharetokens must be > 0") | |
758 | 765 | else { | |
759 | 766 | let invLP = stakeLP(pool, pType, LPId, userShareForStake) | |
760 | 767 | if ((invLP == invLP)) | |
761 | 768 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
762 | 769 | else throw("Strict value is not equal to itself.") | |
763 | 770 | } | |
764 | 771 | } | |
765 | 772 | else throw("Strict value is not equal to itself.") | |
766 | 773 | } | |
767 | 774 | else throw("Strict value is not equal to itself.") | |
768 | 775 | } | |
769 | 776 | ||
770 | 777 | ||
771 | 778 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = { | |
772 | 779 | let totalAmount = getPoolTotalShare(pool) | |
773 | 780 | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
774 | - | let $ | |
781 | + | let $t02190222140 = if (withLoan) | |
775 | 782 | then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount)) | |
776 | 783 | else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan) | |
777 | - | let curPoolInterest = $ | |
778 | - | let totalStakedWithLoan = $ | |
784 | + | let curPoolInterest = $t02190222140._1 | |
785 | + | let totalStakedWithLoan = $t02190222140._2 | |
779 | 786 | [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))] | |
780 | 787 | } | |
781 | 788 | ||
782 | 789 | ||
783 | 790 | func listToInt (a,item) = (a :+ parseIntValue(item)) | |
784 | 791 | ||
785 | 792 | ||
786 | 793 | func directSwopfiCPMM (rArgs,tokenTo) = { | |
787 | 794 | let dApp = addressFromStringValue(rArgs[1]) | |
788 | 795 | let pmtP = split(rArgs[2], "|") | |
789 | 796 | let tokenBalanceBefore = accountBalance(assetIdFromStr(tokenTo)) | |
790 | 797 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
791 | 798 | then { | |
792 | 799 | let pmt = [AttachedPayment(assetIdFromStr(pmtP[0]), parseIntValue(pmtP[1]))] | |
793 | 800 | let minToRecive = rArgs[3] | |
794 | 801 | let inv = invoke(dApp, "callFunction", ["exchange", [minToRecive]], pmt) | |
795 | 802 | if ((inv == inv)) | |
796 | 803 | then (accountBalance(assetIdFromStr(tokenTo)) - tokenBalanceBefore) | |
797 | 804 | else throw("Strict value is not equal to itself.") | |
798 | 805 | } | |
799 | 806 | else throw("Strict value is not equal to itself.") | |
800 | 807 | } | |
801 | 808 | ||
802 | 809 | ||
803 | 810 | func directRoutingSwopfi (rArgs,tokenTo) = { | |
804 | 811 | let dApp = addressFromStringValue(rArgs[1]) | |
805 | 812 | let tokenBalanceBefore = accountBalance(assetIdFromStr(tokenTo)) | |
806 | 813 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
807 | 814 | then { | |
808 | 815 | let pmt = { | |
809 | 816 | let pmtP = split(rArgs[2], "|") | |
810 | 817 | [AttachedPayment(fromBase58String(pmtP[0]), parseIntValue(pmtP[1]))] | |
811 | 818 | } | |
812 | 819 | let args = { | |
813 | 820 | let eArgs = split(rArgs[3], "|") | |
814 | 821 | let exchangers = split(eArgs[0], ",") | |
815 | 822 | let exchangersType = split(eArgs[1], ",") | |
816 | 823 | let args1 = { | |
817 | 824 | let $l = split(eArgs[2], ",") | |
818 | 825 | let $s = size($l) | |
819 | 826 | let $acc0 = nil | |
820 | 827 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
821 | 828 | then $a | |
822 | 829 | else listToInt($a, $l[$i]) | |
823 | 830 | ||
824 | 831 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
825 | 832 | then $a | |
826 | 833 | else throw("List size exceeds 3") | |
827 | 834 | ||
828 | 835 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
829 | 836 | } | |
830 | 837 | let args2 = { | |
831 | 838 | let $l = split(eArgs[3], ",") | |
832 | 839 | let $s = size($l) | |
833 | 840 | let $acc0 = nil | |
834 | 841 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
835 | 842 | then $a | |
836 | 843 | else listToInt($a, $l[$i]) | |
837 | 844 | ||
838 | 845 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
839 | 846 | then $a | |
840 | 847 | else throw("List size exceeds 3") | |
841 | 848 | ||
842 | 849 | $f1_2($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3) | |
843 | 850 | } | |
844 | 851 | let routingAssetsKeys = split(eArgs[4], ",") | |
845 | 852 | let minToRecive = parseIntValue(eArgs[5]) | |
846 | 853 | [exchangers, exchangersType, args1, args2, routingAssetsKeys, minToRecive] | |
847 | 854 | } | |
848 | 855 | let inv = invoke(dApp, "routingTrade", args, pmt) | |
849 | 856 | if ((inv == inv)) | |
850 | 857 | then (accountBalance(assetIdFromStr(tokenTo)) - tokenBalanceBefore) | |
851 | 858 | else throw("Strict value is not equal to itself.") | |
852 | 859 | } | |
853 | 860 | else throw("Strict value is not equal to itself.") | |
854 | 861 | } | |
855 | 862 | ||
856 | 863 | ||
857 | 864 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
858 | 865 | let poolAddr = Address(fromBase58String(pool)) | |
859 | - | let $ | |
860 | - | let AId = $ | |
861 | - | let BId = $ | |
862 | - | let balA = $ | |
863 | - | let balB = $ | |
864 | - | let shareId = $ | |
866 | + | let $t02424724313 = getPoolData(poolAddr, pType) | |
867 | + | let AId = $t02424724313._1 | |
868 | + | let BId = $t02424724313._2 | |
869 | + | let balA = $t02424724313._3 | |
870 | + | let balB = $t02424724313._4 | |
871 | + | let shareId = $t02424724313._5 | |
865 | 872 | if (if ((tokenId != AId)) | |
866 | 873 | then (tokenId != BId) | |
867 | 874 | else false) | |
868 | 875 | then throw("Wrong asset") | |
869 | 876 | else { | |
870 | 877 | let totalShareAmount = getPoolTotalShare(pool) | |
871 | 878 | if ((totalShareAmount == 0)) | |
872 | 879 | then [ScriptTransfer(moneyBox, tokenAmount, fromBase58String(tokenId))] | |
873 | 880 | else { | |
874 | 881 | let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool) | |
875 | 882 | let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount) | |
876 | 883 | let tokensForFeeLoan = fraction(tokenAmount, loanPercent, SCALE8) | |
877 | 884 | let tokensForFeeNoLoan = (tokenAmount - tokensForFeeLoan) | |
878 | 885 | let axlyFeeLoan = fraction(tokensForFeeLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
879 | 886 | let axlyFeeNoLoan = fraction(tokensForFeeNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
880 | 887 | let axlyFee = (axlyFeeLoan + axlyFeeNoLoan) | |
881 | - | let $ | |
888 | + | let $t02505825158 = if ((tokenId == AId)) | |
882 | 889 | then $Tuple2((tokenAmount - axlyFee), 0) | |
883 | 890 | else $Tuple2(0, (tokenAmount - axlyFee)) | |
884 | - | let pmtA = $ | |
885 | - | let pmtB = $ | |
886 | - | let $ | |
887 | - | let stakedAmount = $ | |
888 | - | let nf = $ | |
891 | + | let pmtA = $t02505825158._1 | |
892 | + | let pmtB = $t02505825158._2 | |
893 | + | let $t02516125265 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
894 | + | let stakedAmount = $t02516125265._1 | |
895 | + | let nf = $t02516125265._2 | |
889 | 896 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
890 | 897 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
891 | 898 | let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8) | |
892 | 899 | let stakedNoLoan = (stakedAmount - stakedLoan) | |
893 | 900 | let newInterestLoan = if ((totalShareAmountWithLoan > 0)) | |
894 | 901 | then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan)) | |
895 | 902 | else 0 | |
896 | 903 | let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0)) | |
897 | 904 | then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan))) | |
898 | 905 | else 0 | |
899 | 906 | ([IntegerEntry((pool + kPoolInterestLoan), newInterestLoan), IntegerEntry((pool + kPoolInterestNoLoan), newInterestNoLoan), IntegerEntry((pool + kPoolTotal), (totalShareAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), (totalShareAmountWithLoan + stakedLoan)), ScriptTransfer(moneyBox, axlyFee, assetIdFromStr(tokenId))] ++ getCursEntries(AId, BId, shareId, nil)) | |
900 | 907 | } | |
901 | 908 | } | |
902 | 909 | } | |
903 | 910 | ||
904 | 911 | ||
905 | 912 | func userCanWithdrawShareCalc (user,pool,posId,borrowed) = { | |
906 | 913 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
907 | 914 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)) | |
908 | 915 | let poolInterest = if (borrowed) | |
909 | 916 | then getIntegerValue(this, (pool + kPoolInterestLoan)) | |
910 | 917 | else getIntegerValue(this, (pool + kPoolInterestNoLoan)) | |
911 | 918 | (pAmount + fraction(pAmount, (poolInterest - userInterest), SCALE10)) | |
912 | 919 | } | |
913 | 920 | ||
914 | 921 | ||
915 | 922 | func calcStopLossFee (pool,isBorrowed,stopLoss,lpWithdraw) = { | |
916 | 923 | let feeType = if (isBorrowed) | |
917 | 924 | then STOPLOSS_LOAN | |
918 | 925 | else STOPLOSS_FEE_NO_LOAN | |
919 | 926 | if (stopLoss) | |
920 | 927 | then fraction(lpWithdraw, getAxlyFee(pool, feeType), FEE_SCALE6) | |
921 | 928 | else 0 | |
922 | 929 | } | |
923 | 930 | ||
924 | 931 | ||
925 | 932 | func withdrawToUser (user,pool,posId,stopLoss) = { | |
926 | 933 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
927 | 934 | let isBorrowed = (valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)), 0) > 0) | |
928 | 935 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, isBorrowed) | |
929 | 936 | let poolTotalShare = getPoolTotalShare(pool) | |
930 | 937 | let poolTotalShareLoan = getPoolTotalShareWithLoan(pool) | |
931 | 938 | let userAddr = Address(fromBase58String(user)) | |
932 | 939 | let poolAddr = Address(fromBase58String(pool)) | |
933 | 940 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
934 | - | let $ | |
935 | - | let idAStr = $ | |
936 | - | let idBStr = $ | |
937 | - | let balA = $ | |
938 | - | let balB = $ | |
939 | - | let shareId = $ | |
940 | - | let $ | |
941 | - | let idA = $ | |
942 | - | let idB = $ | |
941 | + | let $t02779427866 = getPoolData(poolAddr, pType) | |
942 | + | let idAStr = $t02779427866._1 | |
943 | + | let idBStr = $t02779427866._2 | |
944 | + | let balA = $t02779427866._3 | |
945 | + | let balB = $t02779427866._4 | |
946 | + | let shareId = $t02779427866._5 | |
947 | + | let $t02786927936 = $Tuple2(assetIdFromStr(idAStr), assetIdFromStr(idBStr)) | |
948 | + | let idA = $t02786927936._1 | |
949 | + | let idB = $t02786927936._2 | |
943 | 950 | let stopLossFee = calcStopLossFee(pool, isBorrowed, stopLoss, userCanWithdraw) | |
944 | 951 | let cBalABefore = accountBalance(idA) | |
945 | 952 | if ((cBalABefore == cBalABefore)) | |
946 | 953 | then { | |
947 | 954 | let cBalBBefore = accountBalance(idB) | |
948 | 955 | if ((cBalBBefore == cBalBBefore)) | |
949 | 956 | then { | |
950 | 957 | let inv = if ((pType == SF_POOL)) | |
951 | 958 | then { | |
952 | 959 | let inv = unstakeLP(pool, pType, shareId, stopLossFee) | |
953 | 960 | if ((inv == inv)) | |
954 | 961 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
955 | 962 | else throw("Strict value is not equal to itself.") | |
956 | 963 | } | |
957 | 964 | else if ((pType == WX_POOL)) | |
958 | 965 | then { | |
959 | 966 | let inv = unstakeLP(pool, pType, shareId, (userCanWithdraw + stopLossFee)) | |
960 | 967 | if ((inv == inv)) | |
961 | 968 | then invoke(poolAddr, "get", nil, [AttachedPayment(assetIdFromStr(shareId), userCanWithdraw)]) | |
962 | 969 | else throw("Strict value is not equal to itself.") | |
963 | 970 | } | |
964 | 971 | else unknownPoolType() | |
965 | 972 | if ((inv == inv)) | |
966 | 973 | then { | |
967 | 974 | let cBalAAfter = accountBalance(idA) | |
968 | 975 | if ((cBalAAfter == cBalAAfter)) | |
969 | 976 | then { | |
970 | 977 | let cBalBAfter = accountBalance(idB) | |
971 | 978 | if ((cBalBAfter == cBalBAfter)) | |
972 | 979 | then { | |
973 | - | let $ | |
974 | - | let tokensAmountA = $ | |
975 | - | let tokensAmountB = $ | |
976 | - | let $ | |
980 | + | let $t02863128720 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
981 | + | let tokensAmountA = $t02863128720._1 | |
982 | + | let tokensAmountB = $t02863128720._2 | |
983 | + | let $t02872329959 = if (isBorrowed) | |
977 | 984 | then { | |
978 | 985 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
979 | 986 | let debt = { | |
980 | 987 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posId), borrowAsset], nil) | |
981 | 988 | if ($isInstanceOf(@, "Int")) | |
982 | 989 | then @ | |
983 | 990 | else throw(($getType(@) + " couldn't be cast to Int")) | |
984 | 991 | } | |
985 | 992 | if ((debt == debt)) | |
986 | 993 | then { | |
987 | 994 | let amountToGetEx = if (if ((borrowAsset == idAStr)) | |
988 | 995 | then (debt > tokensAmountA) | |
989 | 996 | else false) | |
990 | 997 | then (debt - tokensAmountA) | |
991 | 998 | else if (if ((borrowAsset == idBStr)) | |
992 | 999 | then (debt > tokensAmountB) | |
993 | 1000 | else false) | |
994 | 1001 | then (debt - tokensAmountB) | |
995 | 1002 | else 0 | |
996 | 1003 | let exInv = if ((amountToGetEx > 0)) | |
997 | 1004 | then exchangeDirectly(pType, pool, idAStr, idBStr, (balA - tokensAmountA), (balB - tokensAmountB), amountToGetEx, borrowAsset) | |
998 | 1005 | else nil | |
999 | 1006 | if ((exInv == exInv)) | |
1000 | 1007 | then { | |
1001 | 1008 | let cBalAAfterRepay = accountBalance(idA) | |
1002 | 1009 | if ((cBalAAfterRepay == cBalAAfterRepay)) | |
1003 | 1010 | then { | |
1004 | 1011 | let cBalBAfterRepay = accountBalance(idB) | |
1005 | 1012 | if ((cBalBAfterRepay == cBalBAfterRepay)) | |
1006 | 1013 | then { | |
1007 | 1014 | let closeDbtInv = if ((debt > 0)) | |
1008 | 1015 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
1009 | 1016 | else 0 | |
1010 | 1017 | if ((closeDbtInv == closeDbtInv)) | |
1011 | 1018 | then if ((borrowAsset == idAStr)) | |
1012 | 1019 | then $Tuple2(((cBalAAfterRepay - cBalABefore) - debt), (cBalBAfterRepay - cBalBBefore)) | |
1013 | 1020 | else $Tuple2((cBalAAfterRepay - cBalABefore), ((cBalBAfterRepay - cBalBBefore) - debt)) | |
1014 | 1021 | else throw("Strict value is not equal to itself.") | |
1015 | 1022 | } | |
1016 | 1023 | else throw("Strict value is not equal to itself.") | |
1017 | 1024 | } | |
1018 | 1025 | else throw("Strict value is not equal to itself.") | |
1019 | 1026 | } | |
1020 | 1027 | else throw("Strict value is not equal to itself.") | |
1021 | 1028 | } | |
1022 | 1029 | else throw("Strict value is not equal to itself.") | |
1023 | 1030 | } | |
1024 | 1031 | else $Tuple2(tokensAmountA, tokensAmountB) | |
1025 | - | let toUserA = $ | |
1026 | - | let toUserB = $ | |
1032 | + | let toUserA = $t02872329959._1 | |
1033 | + | let toUserB = $t02872329959._2 | |
1027 | 1034 | let poolTotalLoanEntries = if (isBorrowed) | |
1028 | 1035 | then [IntegerEntry((pool + kPoolTotalLoan), ((poolTotalShareLoan - userCanWithdraw) - stopLossFee))] | |
1029 | 1036 | else nil | |
1030 | 1037 | let entries = (([DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition)), DeleteEntry((((user + "_") + posId) + kUserPositionPool)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), ((poolTotalShare - userCanWithdraw) - stopLossFee)), ScriptTransfer(userAddr, toUserA, idA), ScriptTransfer(userAddr, toUserB, idB), ScriptTransfer(moneyBox, stopLossFee, fromBase58String(shareId))] ++ poolTotalLoanEntries) ++ getCursEntries(idAStr, idBStr, shareId, nil)) | |
1031 | 1038 | $Tuple2(entries, [toUserA, toUserB]) | |
1032 | 1039 | } | |
1033 | 1040 | else throw("Strict value is not equal to itself.") | |
1034 | 1041 | } | |
1035 | 1042 | else throw("Strict value is not equal to itself.") | |
1036 | 1043 | } | |
1037 | 1044 | else throw("Strict value is not equal to itself.") | |
1038 | 1045 | } | |
1039 | 1046 | else throw("Strict value is not equal to itself.") | |
1040 | 1047 | } | |
1041 | 1048 | else throw("Strict value is not equal to itself.") | |
1042 | 1049 | } | |
1043 | 1050 | ||
1044 | 1051 | ||
1045 | 1052 | func parseRequest (requestId) = { | |
1046 | 1053 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
1047 | 1054 | let user = request[0] | |
1048 | 1055 | let pool = request[1] | |
1049 | 1056 | let pmtA = parseIntValue(request[2]) | |
1050 | 1057 | let AId = request[3] | |
1051 | 1058 | let pmtB = parseIntValue(request[4]) | |
1052 | 1059 | let BId = request[5] | |
1053 | 1060 | let balA = parseIntValue(request[6]) | |
1054 | 1061 | let balB = parseIntValue(request[7]) | |
1055 | 1062 | let shareId = request[8] | |
1056 | 1063 | let bwAsset = request[9] | |
1057 | 1064 | let bwAmount = parseIntValue(request[10]) | |
1058 | 1065 | $Tuple11(user, pool, pmtA, AId, pmtB, BId, balA, balB, shareId, bwAsset, bwAmount) | |
1059 | 1066 | } | |
1060 | 1067 | ||
1061 | 1068 | ||
1062 | 1069 | func calcBorrowAmount (pmtA,pmtB,aId,bId,leverage,borrowId) = if (if ((borrowId != aId)) | |
1063 | 1070 | then (borrowId != bId) | |
1064 | 1071 | else false) | |
1065 | 1072 | then throw("Wrong borrow asset") | |
1066 | 1073 | else { | |
1067 | 1074 | let dPriceA = getIntegerValue(priceOracleAddr, (aId + kPriceInOracle)) | |
1068 | 1075 | let dPriceB = getIntegerValue(priceOracleAddr, (bId + kPriceInOracle)) | |
1069 | 1076 | let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
1070 | 1077 | let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
1071 | 1078 | let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB)) | |
1072 | - | let $ | |
1079 | + | let $t03194132038 = if ((borrowId == aId)) | |
1073 | 1080 | then $Tuple2(dPriceA, decPrA) | |
1074 | 1081 | else $Tuple2(dPriceB, decPrB) | |
1075 | - | let borrowPrice = $ | |
1076 | - | let borrowDecPr = $ | |
1082 | + | let borrowPrice = $t03194132038._1 | |
1083 | + | let borrowDecPr = $t03194132038._2 | |
1077 | 1084 | fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice) | |
1078 | 1085 | } | |
1079 | 1086 | ||
1080 | 1087 | ||
1081 | 1088 | func parseReplenishPmts (pmts,AId,BId) = if ((size(pmts) == 2)) | |
1082 | 1089 | then if ((assetIdToStr(pmts[0].assetId) != AId)) | |
1083 | 1090 | then throw("Wrong payment asset A") | |
1084 | 1091 | else if ((assetIdToStr(pmts[1].assetId) != BId)) | |
1085 | 1092 | then throw("Wrong payment asset B") | |
1086 | 1093 | else $Tuple2(pmts[0].amount, pmts[1].amount) | |
1087 | 1094 | else if ((size(pmts) == 1)) | |
1088 | 1095 | then if ((assetIdToStr(pmts[0].assetId) == AId)) | |
1089 | 1096 | then $Tuple2(pmts[0].amount, 0) | |
1090 | 1097 | else if ((assetIdToStr(pmts[0].assetId) == BId)) | |
1091 | 1098 | then $Tuple2(0, pmts[0].amount) | |
1092 | 1099 | else throw("Wrong payment") | |
1093 | 1100 | else throw("One or two payments expected") | |
1094 | 1101 | ||
1095 | 1102 | ||
1096 | 1103 | func calcPriceImpact (balA,balB,newBalA,newBalB) = { | |
1097 | 1104 | let pri = ((SCALE8 - fraction(fraction(balB, SCALE8, balA), SCALE8, fraction(newBalB, SCALE8, newBalA))) * 100) | |
1098 | 1105 | if ((0 > pri)) | |
1099 | 1106 | then (pri * -1) | |
1100 | 1107 | else pri | |
1101 | 1108 | } | |
1102 | 1109 | ||
1103 | 1110 | ||
1104 | 1111 | func claimAndCheckAmnt (pool,pType,claim,amount,change) = { | |
1105 | - | let $ | |
1112 | + | let $t03303833300 = if (claim) | |
1106 | 1113 | then claimFarmed(pType, pool) | |
1107 | 1114 | else { | |
1108 | 1115 | let claimedAsset = if ((pType == SF_POOL)) | |
1109 | 1116 | then SWOPID | |
1110 | 1117 | else if ((pType == WX_POOL)) | |
1111 | 1118 | then WXID | |
1112 | 1119 | else unknownPoolType() | |
1113 | 1120 | $Tuple2(amount, claimedAsset) | |
1114 | 1121 | } | |
1115 | - | if (($ | |
1122 | + | if (($t03303833300 == $t03303833300)) | |
1116 | 1123 | then { | |
1117 | - | let claimAsset = $ | |
1118 | - | let claimAmount = $ | |
1124 | + | let claimAsset = $t03303833300._2 | |
1125 | + | let claimAmount = $t03303833300._1 | |
1119 | 1126 | let bal = accountBalance(claimAsset) | |
1120 | 1127 | if ((bal == bal)) | |
1121 | 1128 | then if ((amount > bal)) | |
1122 | 1129 | then throw("To big amount to exchange") | |
1123 | 1130 | else $Tuple2(claimAmount, claimAsset) | |
1124 | 1131 | else throw("Strict value is not equal to itself.") | |
1125 | 1132 | } | |
1126 | 1133 | else throw("Strict value is not equal to itself.") | |
1127 | 1134 | } | |
1128 | 1135 | ||
1129 | 1136 | ||
1130 | 1137 | @Callable(i) | |
1131 | 1138 | func getPoolInfoREADONLY (pool) = { | |
1132 | 1139 | let poolAddr = addressFromStringValue(pool) | |
1133 | 1140 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1134 | - | let $ | |
1135 | - | let AId = $ | |
1136 | - | let BId = $ | |
1137 | - | let balA = $ | |
1138 | - | let balB = $ | |
1139 | - | let shareId = $ | |
1141 | + | let $t03366733757 = getPoolData(Address(fromBase58String(pool)), pType) | |
1142 | + | let AId = $t03366733757._1 | |
1143 | + | let BId = $t03366733757._2 | |
1144 | + | let balA = $t03366733757._3 | |
1145 | + | let balB = $t03366733757._4 | |
1146 | + | let shareId = $t03366733757._5 | |
1140 | 1147 | let shareSupply = getShareSupply(poolAddr, pType, shareId) | |
1141 | 1148 | $Tuple2(nil, $Tuple6(AId, BId, shareId, balA, balB, shareSupply)) | |
1142 | 1149 | } | |
1143 | 1150 | ||
1144 | 1151 | ||
1145 | 1152 | ||
1146 | 1153 | @Callable(i) | |
1147 | 1154 | func getShareAssetPriceREADONLY (shareId) = { | |
1148 | 1155 | let sharePrices = getSharePrice(shareId) | |
1149 | 1156 | $Tuple2(nil, sharePrices) | |
1150 | 1157 | } | |
1151 | 1158 | ||
1152 | 1159 | ||
1153 | 1160 | ||
1154 | 1161 | @Callable(i) | |
1155 | 1162 | func getUserPositionShareAmountREADONLY (user,posNum) = { | |
1156 | 1163 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posNum) + kUserPositionPool)), "Unknown position") | |
1157 | 1164 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posNum) + kUserBorrowAmount)) | |
1158 | 1165 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum, (borrowAmount > 0)) | |
1159 | 1166 | $Tuple2(nil, userCanWithdraw) | |
1160 | 1167 | } | |
1161 | 1168 | ||
1162 | 1169 | ||
1163 | 1170 | ||
1164 | 1171 | @Callable(i) | |
1165 | 1172 | func getUserPositionREADONLY (user,pools,posNum) = { | |
1166 | 1173 | func userPos (a,pool) = { | |
1167 | - | let $ | |
1168 | - | let wAmountsA = $ | |
1169 | - | let wAmountsB = $ | |
1170 | - | let debts = $ | |
1171 | - | let eqWAmountsA = $ | |
1172 | - | let eqWAmountsB = $ | |
1173 | - | let index = $ | |
1174 | + | let $t03463034700 = a | |
1175 | + | let wAmountsA = $t03463034700._1 | |
1176 | + | let wAmountsB = $t03463034700._2 | |
1177 | + | let debts = $t03463034700._3 | |
1178 | + | let eqWAmountsA = $t03463034700._4 | |
1179 | + | let eqWAmountsB = $t03463034700._5 | |
1180 | + | let index = $t03463034700._6 | |
1174 | 1181 | if (!(isDefined(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserPosition))))) | |
1175 | 1182 | then $Tuple6((wAmountsA :+ 0), (wAmountsB :+ 0), (debts :+ 0), (eqWAmountsA :+ 0), (eqWAmountsB :+ 0), (index + 1)) | |
1176 | 1183 | else { | |
1177 | 1184 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1178 | - | let $ | |
1179 | - | let AId = $ | |
1180 | - | let BId = $ | |
1181 | - | let balA = $ | |
1182 | - | let balB = $ | |
1183 | - | let shareId = $ | |
1185 | + | let $t03497935069 = getPoolData(Address(fromBase58String(pool)), pType) | |
1186 | + | let AId = $t03497935069._1 | |
1187 | + | let BId = $t03497935069._2 | |
1188 | + | let balA = $t03497935069._3 | |
1189 | + | let balB = $t03497935069._4 | |
1190 | + | let shareId = $t03497935069._5 | |
1184 | 1191 | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0) | |
1185 | 1192 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0)) | |
1186 | - | let $ | |
1187 | - | let wAmountA = $ | |
1188 | - | let wAmountB = $ | |
1193 | + | let $t03528535405 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userCanWithdraw) | |
1194 | + | let wAmountA = $t03528535405._1 | |
1195 | + | let wAmountB = $t03528535405._2 | |
1189 | 1196 | if ((borrowAmount > 0)) | |
1190 | 1197 | then { | |
1191 | 1198 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAssetId)) | |
1192 | 1199 | let debt = { | |
1193 | 1200 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posNum[index]), borrowAsset], nil) | |
1194 | 1201 | if ($isInstanceOf(@, "Int")) | |
1195 | 1202 | then @ | |
1196 | 1203 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1197 | 1204 | } | |
1198 | 1205 | if ((debt == debt)) | |
1199 | 1206 | then { | |
1200 | 1207 | let amountToGetEx = if (if ((borrowAsset == AId)) | |
1201 | 1208 | then (debt > wAmountA) | |
1202 | 1209 | else false) | |
1203 | 1210 | then (debt - wAmountA) | |
1204 | 1211 | else if (if ((borrowAsset == BId)) | |
1205 | 1212 | then (debt > wAmountB) | |
1206 | 1213 | else false) | |
1207 | 1214 | then (debt - wAmountB) | |
1208 | 1215 | else 0 | |
1209 | 1216 | let amountToPay = if ((amountToGetEx > 0)) | |
1210 | 1217 | then if ((pType == SF_POOL)) | |
1211 | 1218 | then { | |
1212 | 1219 | let ex = calcAmountToPaySF(pool, AId, BId, balA, balB, amountToGetEx, borrowAsset) | |
1213 | 1220 | ex._2 | |
1214 | 1221 | } | |
1215 | 1222 | else if ((pType == WX_POOL)) | |
1216 | 1223 | then { | |
1217 | 1224 | let ex = calcAmountToPayWX(pool, AId, BId, balA, balB, amountToGetEx, borrowAsset) | |
1218 | 1225 | ex._2 | |
1219 | 1226 | } | |
1220 | 1227 | else unknownPoolType() | |
1221 | 1228 | else 0 | |
1222 | - | let $ | |
1229 | + | let $t03631736536 = if ((borrowAsset == AId)) | |
1223 | 1230 | then $Tuple2(((wAmountA + amountToGetEx) - debt), (wAmountB - amountToPay)) | |
1224 | 1231 | else $Tuple2((wAmountA - amountToPay), ((wAmountB + amountToGetEx) - debt)) | |
1225 | - | let eqWAmountA = $ | |
1226 | - | let eqWAmountB = $ | |
1232 | + | let eqWAmountA = $t03631736536._1 | |
1233 | + | let eqWAmountB = $t03631736536._2 | |
1227 | 1234 | $Tuple6((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (debts :+ debt), (eqWAmountsA :+ eqWAmountA), (eqWAmountsB :+ eqWAmountB), (index + 1)) | |
1228 | 1235 | } | |
1229 | 1236 | else throw("Strict value is not equal to itself.") | |
1230 | 1237 | } | |
1231 | 1238 | else $Tuple6((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), debts, (wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (index + 1)) | |
1232 | 1239 | } | |
1233 | 1240 | } | |
1234 | 1241 | ||
1235 | - | let $ | |
1242 | + | let $t03679136902 = { | |
1236 | 1243 | let $l = pools | |
1237 | 1244 | let $s = size($l) | |
1238 | 1245 | let $acc0 = $Tuple6(nil, nil, nil, nil, nil, 0) | |
1239 | 1246 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1240 | 1247 | then $a | |
1241 | 1248 | else userPos($a, $l[$i]) | |
1242 | 1249 | ||
1243 | 1250 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1244 | 1251 | then $a | |
1245 | 1252 | else throw("List size exceeds 20") | |
1246 | 1253 | ||
1247 | 1254 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
1248 | 1255 | } | |
1249 | - | let wAmountsA = $ | |
1250 | - | let wAmountsB = $ | |
1251 | - | let debts = $ | |
1252 | - | let eqWAmountsA = $ | |
1253 | - | let eqWAmountsB = $ | |
1256 | + | let wAmountsA = $t03679136902._1 | |
1257 | + | let wAmountsB = $t03679136902._2 | |
1258 | + | let debts = $t03679136902._3 | |
1259 | + | let eqWAmountsA = $t03679136902._4 | |
1260 | + | let eqWAmountsB = $t03679136902._5 | |
1254 | 1261 | $Tuple2(nil, $Tuple5(wAmountsA, wAmountsB, debts, eqWAmountsA, eqWAmountsB)) | |
1255 | 1262 | } | |
1256 | 1263 | ||
1257 | 1264 | ||
1258 | 1265 | ||
1259 | 1266 | @Callable(i) | |
1260 | 1267 | func replenish (pool,leverage,borrowId) = valueOrElse(isActiveForUsers(), { | |
1261 | 1268 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1262 | 1269 | if (!(isPoolActive(pool, pType))) | |
1263 | 1270 | then throw("Pool not active at this moment") | |
1264 | 1271 | else if (if ((100 > leverage)) | |
1265 | 1272 | then true | |
1266 | 1273 | else (leverage > 300)) | |
1267 | 1274 | then throw("Leverage can't be <100 and >300") | |
1268 | 1275 | else if (if (!(getBooleanValue(this, (pool + kPoolCanBorrow)))) | |
1269 | 1276 | then (leverage > 100) | |
1270 | 1277 | else false) | |
1271 | 1278 | then throw("You can't borrow in this pool") | |
1272 | 1279 | else { | |
1273 | - | let $ | |
1274 | - | let AId = $ | |
1275 | - | let BId = $ | |
1276 | - | let balA = $ | |
1277 | - | let balB = $ | |
1278 | - | let shareId = $ | |
1280 | + | let $t03750037590 = getPoolData(Address(fromBase58String(pool)), pType) | |
1281 | + | let AId = $t03750037590._1 | |
1282 | + | let BId = $t03750037590._2 | |
1283 | + | let balA = $t03750037590._3 | |
1284 | + | let balB = $t03750037590._4 | |
1285 | + | let shareId = $t03750037590._5 | |
1279 | 1286 | if (if ((borrowId != AId)) | |
1280 | 1287 | then (borrowId != BId) | |
1281 | 1288 | else false) | |
1282 | 1289 | then throw("Wrong borrow asset") | |
1283 | 1290 | else { | |
1284 | - | let $ | |
1285 | - | let pmtA = $ | |
1286 | - | let pmtB = $ | |
1291 | + | let $t03767137730 = parseReplenishPmts(i.payments, AId, BId) | |
1292 | + | let pmtA = $t03767137730._1 | |
1293 | + | let pmtB = $t03767137730._2 | |
1287 | 1294 | let user = toString(i.caller) | |
1288 | 1295 | let newPosNum = getNewUserPositionNumber(user) | |
1289 | 1296 | if ((leverage > 100)) | |
1290 | 1297 | then { | |
1291 | 1298 | let borrowAmount = calcBorrowAmount(pmtA, pmtB, AId, BId, leverage, borrowId) | |
1292 | 1299 | let request = makeString([user, pool, toString(pmtA), AId, toString(pmtB), BId, toString(balA), toString(balB), shareId, borrowId, toString(borrowAmount)], ",") | |
1293 | 1300 | let newRequestId = { | |
1294 | 1301 | let @ = invoke(this, "createNewRequest", [request], nil) | |
1295 | 1302 | if ($isInstanceOf(@, "Int")) | |
1296 | 1303 | then @ | |
1297 | 1304 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1298 | 1305 | } | |
1299 | 1306 | if ((newRequestId == newRequestId)) | |
1300 | 1307 | then { | |
1301 | 1308 | let args = [((user + "_") + toString(newPosNum)), shareId, borrowId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
1302 | 1309 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
1303 | 1310 | if ((inv == inv)) | |
1304 | 1311 | then { | |
1305 | 1312 | let userStaked = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPosition)) | |
1306 | - | let $ | |
1307 | - | if (($ | |
1313 | + | let $t03871938813 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1314 | + | if (($t03871938813 == $t03871938813)) | |
1308 | 1315 | then { | |
1309 | - | let newBalB = $ | |
1310 | - | let newBalA = $ | |
1316 | + | let newBalB = $t03871938813._2 | |
1317 | + | let newBalA = $t03871938813._1 | |
1311 | 1318 | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1312 | - | let $ | |
1313 | - | let wAmountA = $ | |
1314 | - | let wAmountB = $ | |
1319 | + | let $t03888338998 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1320 | + | let wAmountA = $t03888338998._1 | |
1321 | + | let wAmountB = $t03888338998._2 | |
1315 | 1322 | $Tuple2(nil, [prImpact, wAmountA, wAmountB]) | |
1316 | 1323 | } | |
1317 | 1324 | else throw("Strict value is not equal to itself.") | |
1318 | 1325 | } | |
1319 | 1326 | else throw("Strict value is not equal to itself.") | |
1320 | 1327 | } | |
1321 | 1328 | else throw("Strict value is not equal to itself.") | |
1322 | 1329 | } | |
1323 | 1330 | else { | |
1324 | - | let $ | |
1325 | - | if (($ | |
1331 | + | let $t03905139166 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1332 | + | if (($t03905139166 == $t03905139166)) | |
1326 | 1333 | then { | |
1327 | - | let axlyFee = $ | |
1328 | - | let userStaked = $ | |
1329 | - | let $ | |
1330 | - | if (($ | |
1334 | + | let axlyFee = $t03905139166._2 | |
1335 | + | let userStaked = $t03905139166._1 | |
1336 | + | let $t03917239266 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1337 | + | if (($t03917239266 == $t03917239266)) | |
1331 | 1338 | then { | |
1332 | - | let newBalB = $ | |
1333 | - | let newBalA = $ | |
1339 | + | let newBalB = $t03917239266._2 | |
1340 | + | let newBalA = $t03917239266._1 | |
1334 | 1341 | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1335 | - | let $ | |
1336 | - | let wAmountA = $ | |
1337 | - | let wAmountB = $ | |
1342 | + | let $t03933639451 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1343 | + | let wAmountA = $t03933639451._1 | |
1344 | + | let wAmountB = $t03933639451._2 | |
1338 | 1345 | $Tuple2((replenishEntries(pool, user, userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])), [prImpact, wAmountA, wAmountB]) | |
1339 | 1346 | } | |
1340 | 1347 | else throw("Strict value is not equal to itself.") | |
1341 | 1348 | } | |
1342 | 1349 | else throw("Strict value is not equal to itself.") | |
1343 | 1350 | } | |
1344 | 1351 | } | |
1345 | 1352 | } | |
1346 | 1353 | }) | |
1347 | 1354 | ||
1348 | 1355 | ||
1349 | 1356 | ||
1350 | 1357 | @Callable(i) | |
1351 | 1358 | func withdraw (pool,posId) = valueOrElse(isActiveForUsers(), { | |
1352 | 1359 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1353 | 1360 | if (!(isPoolActive(pool, pType))) | |
1354 | 1361 | then throw("Pool not active at this moment") | |
1355 | 1362 | else withdrawToUser(toString(i.caller), pool, toString(posId), false) | |
1356 | 1363 | }) | |
1357 | 1364 | ||
1358 | 1365 | ||
1359 | 1366 | ||
1360 | 1367 | @Callable(i) | |
1361 | 1368 | func createUpdateStopLoss (posId,poolId,assetId,price) = valueOrElse(isActiveForUsers(), { | |
1362 | 1369 | let tokenOraclePrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle)) | |
1363 | 1370 | let pType = valueOrErrorMessage(getString(this, (kPool + poolId)), "Pool is not inited") | |
1364 | 1371 | if (!(isPoolActive(poolId, pType))) | |
1365 | 1372 | then throw("Pool not active at this moment") | |
1366 | 1373 | else if (!(isDefined(getInteger(this, (((((poolId + "_") + toString(i.caller)) + "_") + toString(posId)) + kUserPosition))))) | |
1367 | 1374 | then throw("There are no user position") | |
1368 | 1375 | else if ((0 >= price)) | |
1369 | 1376 | then throw("Price must be greater than 0") | |
1370 | 1377 | else if ((price > tokenOraclePrice)) | |
1371 | 1378 | then throw("Price must be less than current token price") | |
1372 | 1379 | else [IntegerEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss), price)] | |
1373 | 1380 | }) | |
1374 | 1381 | ||
1375 | 1382 | ||
1376 | 1383 | ||
1377 | 1384 | @Callable(i) | |
1378 | 1385 | func deleteStopLoss (posId,poolId,assetId) = valueOrElse(isActiveForUsers(), { | |
1379 | 1386 | let pType = valueOrErrorMessage(getString(this, (kPool + poolId)), "Pool is not inited") | |
1380 | 1387 | if (!(isPoolActive(poolId, pType))) | |
1381 | 1388 | then throw("Pool not active at this moment") | |
1382 | 1389 | else if (!(isDefined(getInteger(this, (((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))))) | |
1383 | 1390 | then throw("No entry") | |
1384 | 1391 | else [DeleteEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))] | |
1385 | 1392 | }) | |
1386 | 1393 | ||
1387 | 1394 | ||
1388 | 1395 | ||
1389 | 1396 | @Callable(i) | |
1390 | 1397 | func init (moneyBoxAddr,sfFarmingAddr,lendAddr,priceOracleAddr,keeperExContract,wxSwapContract,swopAssetId,wxAssetId,operatorPubKey,group1Admin1PubKey,group1Admin2PubKey,group2Admin1PubKey,group2Admin2PubKey) = valueOrElse(isSelfCall(i), if (isDefined(getString(kOperatorCallPK))) | |
1391 | 1398 | then throw("Already inited") | |
1392 | 1399 | else if (!(isDefined(addressFromString(moneyBoxAddr)))) | |
1393 | 1400 | then throw("moneyBoxAddr is not correct address") | |
1394 | 1401 | else if (!(isDefined(addressFromString(sfFarmingAddr)))) | |
1395 | 1402 | then throw("sfFarmingAddr is not correct address") | |
1396 | 1403 | else if (!(isDefined(addressFromString(lendAddr)))) | |
1397 | 1404 | then throw("lendAddr is not correct address") | |
1398 | 1405 | else if (!(isDefined(addressFromString(priceOracleAddr)))) | |
1399 | 1406 | then throw("priceOracleAddr is not correct address") | |
1400 | 1407 | else if (!(isDefined(addressFromString(keeperExContract)))) | |
1401 | 1408 | then throw("keeperExContract is not correct address") | |
1402 | 1409 | else if (!(isDefined(assetInfo(fromBase58String(swopAssetId))))) | |
1403 | 1410 | then throw("swopAssetId is not correct asset id") | |
1404 | 1411 | else if (!(isDefined(assetInfo(fromBase58String(wxAssetId))))) | |
1405 | 1412 | then throw("swopAssetId is not correct asset id") | |
1406 | 1413 | else if ((size(fromBase58String(operatorPubKey)) != 32)) | |
1407 | 1414 | then throw("operatorPubKey is not correct") | |
1408 | 1415 | else if ((size(fromBase58String(group1Admin1PubKey)) != 32)) | |
1409 | 1416 | then throw("group1Admin1PubKey is not correct") | |
1410 | 1417 | else if ((size(fromBase58String(group1Admin2PubKey)) != 32)) | |
1411 | 1418 | then throw("group1Admin2PubKey is not correct") | |
1412 | 1419 | else if ((size(fromBase58String(group2Admin1PubKey)) != 32)) | |
1413 | 1420 | then throw("group2Admin1PubKey is not correct") | |
1414 | 1421 | else if ((size(fromBase58String(group2Admin2PubKey)) != 32)) | |
1415 | 1422 | then throw("group2Admin2PubKey is not correct") | |
1416 | 1423 | else [StringEntry(kMoneyBox, moneyBoxAddr), StringEntry(kSFFarmingAddr, sfFarmingAddr), StringEntry(kLendService, lendAddr), StringEntry(kPriceOracle, priceOracleAddr), StringEntry(kExContract, keeperExContract), StringEntry(kWxSwapContract, wxSwapContract), StringEntry(kSwopId, swopAssetId), StringEntry(kWxId, wxAssetId), StringEntry(kOperatorCallPK, operatorPubKey), StringEntry(kGroup1Admin1PK, group1Admin1PubKey), StringEntry(kGroup1Admin2PK, group1Admin2PubKey), StringEntry(kGroup2Admin1PK, group2Admin1PubKey), StringEntry(kGroup2Admin2PK, group2Admin2PubKey)]) | |
1417 | 1424 | ||
1418 | 1425 | ||
1419 | 1426 | ||
1420 | 1427 | @Callable(i) | |
1421 | 1428 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
1422 | 1429 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
1423 | 1430 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId) | |
1424 | 1431 | }) | |
1425 | 1432 | ||
1426 | 1433 | ||
1427 | 1434 | ||
1428 | 1435 | @Callable(i) | |
1429 | 1436 | func replenishFromLand (requestId) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1430 | - | let $ | |
1431 | - | let user = $ | |
1432 | - | let pool = $ | |
1433 | - | let pmtA = $ | |
1434 | - | let AId = $ | |
1435 | - | let pmtB = $ | |
1436 | - | let BId = $ | |
1437 | - | let balA = $ | |
1438 | - | let balB = $ | |
1439 | - | let shareId = $ | |
1440 | - | let bwAsset = $ | |
1441 | - | let bwAmount = $ | |
1437 | + | let $t04429044394 = parseRequest(requestId) | |
1438 | + | let user = $t04429044394._1 | |
1439 | + | let pool = $t04429044394._2 | |
1440 | + | let pmtA = $t04429044394._3 | |
1441 | + | let AId = $t04429044394._4 | |
1442 | + | let pmtB = $t04429044394._5 | |
1443 | + | let BId = $t04429044394._6 | |
1444 | + | let balA = $t04429044394._7 | |
1445 | + | let balB = $t04429044394._8 | |
1446 | + | let shareId = $t04429044394._9 | |
1447 | + | let bwAsset = $t04429044394._10 | |
1448 | + | let bwAmount = $t04429044394._11 | |
1442 | 1449 | if ((size(i.payments) != 1)) | |
1443 | 1450 | then throw("Wrong payment size") | |
1444 | 1451 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
1445 | 1452 | then true | |
1446 | 1453 | else (i.payments[0].amount != bwAmount)) | |
1447 | 1454 | then throw("Wrong payment") | |
1448 | 1455 | else { | |
1449 | - | let $ | |
1456 | + | let $t04458444684 = if ((AId == bwAsset)) | |
1450 | 1457 | then $Tuple2((pmtA + bwAmount), pmtB) | |
1451 | 1458 | else $Tuple2(pmtA, (pmtB + bwAmount)) | |
1452 | - | let pmtAllA = $ | |
1453 | - | let pmtAllB = $ | |
1459 | + | let pmtAllA = $t04458444684._1 | |
1460 | + | let pmtAllB = $t04458444684._2 | |
1454 | 1461 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
1455 | - | let $ | |
1456 | - | let userStaked = $ | |
1457 | - | let axlyFee = $ | |
1462 | + | let $t04476644881 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId) | |
1463 | + | let userStaked = $t04476644881._1 | |
1464 | + | let axlyFee = $t04476644881._2 | |
1458 | 1465 | let posNum = getNewUserPositionNumber(user) | |
1459 | 1466 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
1460 | 1467 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
1461 | - | let $ | |
1462 | - | let wAmountA = $ | |
1463 | - | let wAmountB = $ | |
1468 | + | let $t04524145356 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1469 | + | let wAmountA = $t04524145356._1 | |
1470 | + | let wAmountB = $t04524145356._2 | |
1464 | 1471 | $Tuple2((((entries ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
1465 | 1472 | } | |
1466 | 1473 | })) | |
1467 | 1474 | ||
1468 | 1475 | ||
1469 | 1476 | ||
1470 | 1477 | @Callable(i) | |
1471 | 1478 | func liquidate (user,posId,liquidateAmount) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1472 | 1479 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1473 | 1480 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1474 | - | let $ | |
1475 | - | let AId = $ | |
1476 | - | let BId = $ | |
1477 | - | let balA = $ | |
1478 | - | let balB = $ | |
1479 | - | let shareId = $ | |
1481 | + | let $t04587745967 = getPoolData(Address(fromBase58String(pool)), pType) | |
1482 | + | let AId = $t04587745967._1 | |
1483 | + | let BId = $t04587745967._2 | |
1484 | + | let balA = $t04587745967._3 | |
1485 | + | let balB = $t04587745967._4 | |
1486 | + | let shareId = $t04587745967._5 | |
1480 | 1487 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1481 | 1488 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1482 | 1489 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1483 | 1490 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0)) | |
1484 | 1491 | if ((liquidateAmount > userCanWithdraw)) | |
1485 | 1492 | then throw("You can't liquidate more than user have") | |
1486 | 1493 | else if ((borrowAmount == 0)) | |
1487 | 1494 | then throw("You can't liquidate position without borrow") | |
1488 | 1495 | 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))] | |
1489 | 1496 | })) | |
1490 | 1497 | ||
1491 | 1498 | ||
1492 | 1499 | ||
1493 | 1500 | @Callable(i) | |
1494 | 1501 | func stopLoss (user,posId,pool,assetId) = valueOrElse(isActive(), valueOrElse(isOperatorCall(i), { | |
1495 | 1502 | let tokenOraclePrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle)) | |
1496 | 1503 | let stopLossPrice = valueOrErrorMessage(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)), "No entry") | |
1497 | 1504 | if ((tokenOraclePrice > stopLossPrice)) | |
1498 | 1505 | then throw("Token price greater stop loss price") | |
1499 | 1506 | else { | |
1500 | 1507 | let res = withdrawToUser(user, pool, toString(posId), true) | |
1501 | 1508 | $Tuple2((res._1 :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))), res._2) | |
1502 | 1509 | } | |
1503 | 1510 | })) | |
1504 | 1511 | ||
1505 | 1512 | ||
1506 | 1513 | ||
1507 | 1514 | @Callable(i) | |
1508 | 1515 | func capitalizeEx (pool,route,tokenToId,amountToExchange,claim) = valueOrElse(isActive(), valueOrElse(isOperatorCall(i), { | |
1509 | 1516 | let pType = getStringValue(this, (kPool + pool)) | |
1510 | 1517 | let change = valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0) | |
1511 | - | let $ | |
1512 | - | if (($ | |
1518 | + | let $t04793748039 = claimAndCheckAmnt(pool, pType, claim, amountToExchange, change) | |
1519 | + | if (($t04793748039 == $t04793748039)) | |
1513 | 1520 | then { | |
1514 | - | let claimedAsset = $ | |
1515 | - | let claimedAmount = $ | |
1521 | + | let claimedAsset = $t04793748039._2 | |
1522 | + | let claimedAmount = $t04793748039._1 | |
1516 | 1523 | let rArgs = split(route, "__") | |
1517 | 1524 | let exchangedAmount = if ((rArgs[0] == "directSwopfiCPMM")) | |
1518 | 1525 | then directSwopfiCPMM(rArgs, tokenToId) | |
1519 | 1526 | else if ((rArgs[0] == "routingSwopfi")) | |
1520 | 1527 | then directRoutingSwopfi(rArgs, tokenToId) | |
1521 | 1528 | else throw("Wrong route") | |
1522 | 1529 | if ((exchangedAmount == exchangedAmount)) | |
1523 | 1530 | then { | |
1524 | 1531 | let newChange = ((claimedAmount + change) - amountToExchange) | |
1525 | 1532 | let changeEntry = if ((newChange >= 0)) | |
1526 | 1533 | then [IntegerEntry((pool + kPoolCapChange), newChange)] | |
1527 | 1534 | else nil | |
1528 | 1535 | (capitalize(pool, pType, tokenToId, exchangedAmount) ++ changeEntry) | |
1529 | 1536 | } | |
1530 | 1537 | else throw("Strict value is not equal to itself.") | |
1531 | 1538 | } | |
1532 | 1539 | else throw("Strict value is not equal to itself.") | |
1533 | 1540 | })) | |
1534 | 1541 | ||
1535 | 1542 | ||
1536 | 1543 | ||
1537 | 1544 | @Callable(i) | |
1538 | 1545 | func capitalizeNoEx (pool,claim,amountFromBalance) = valueOrElse(isActive(), valueOrElse(isOperatorCall(i), { | |
1539 | 1546 | let pType = getStringValue(this, (kPool + pool)) | |
1540 | - | let $ | |
1541 | - | if (($ | |
1547 | + | let $t04872348821 = claimAndCheckAmnt(pool, pType, claim, amountFromBalance, 0) | |
1548 | + | if (($t04872348821 == $t04872348821)) | |
1542 | 1549 | then { | |
1543 | - | let claimedAsset = $ | |
1544 | - | let claimedAmount = $ | |
1550 | + | let claimedAsset = $t04872348821._2 | |
1551 | + | let claimedAmount = $t04872348821._1 | |
1545 | 1552 | capitalize(pool, pType, assetIdToStr(claimedAsset), (claimedAmount + amountFromBalance)) | |
1546 | 1553 | } | |
1547 | 1554 | else throw("Strict value is not equal to itself.") | |
1548 | 1555 | })) | |
1549 | 1556 | ||
1550 | 1557 | ||
1551 | 1558 | ||
1552 | 1559 | @Callable(i) | |
1553 | 1560 | func initNewPool (type,poolType,poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan,stoplossFeeNoLoan,stoplossFeeWithLoan,canBorrow) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if (if ((type != SF_POOL)) | |
1554 | 1561 | then (type != WX_POOL) | |
1555 | 1562 | else false) | |
1556 | 1563 | then throw("Wrong type") | |
1557 | 1564 | else if (if ((poolType != CPMM)) | |
1558 | 1565 | then (poolType != FLAT) | |
1559 | 1566 | else false) | |
1560 | 1567 | then throw("Wrong pool type") | |
1561 | 1568 | else { | |
1562 | - | let $ | |
1563 | - | let aId = $ | |
1564 | - | let bId = $ | |
1565 | - | let aBal = $ | |
1566 | - | let bBal = $ | |
1567 | - | let shareId = $ | |
1569 | + | let $t04934249436 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1570 | + | let aId = $t04934249436._1 | |
1571 | + | let bId = $t04934249436._2 | |
1572 | + | let aBal = $t04934249436._3 | |
1573 | + | let bBal = $t04934249436._4 | |
1574 | + | let shareId = $t04934249436._5 | |
1568 | 1575 | if ((0 > inFeeNoLoan)) | |
1569 | 1576 | then throw("inFeeNoLoan must be greater than 0") | |
1570 | 1577 | else if ((0 > inFeeLoan)) | |
1571 | 1578 | then throw("inFeeLoan must be greater than 0") | |
1572 | 1579 | else if ((0 > capFeeNoLoan)) | |
1573 | 1580 | then throw("capFeeNoLoan must be greater than 0") | |
1574 | 1581 | else if ((0 > capFeeWithLoan)) | |
1575 | 1582 | then throw("capFeeWithLoan must be greater than 0") | |
1576 | 1583 | else if ((0 > stoplossFeeNoLoan)) | |
1577 | 1584 | then throw("stoplossFeeNoLoan must be greater than 0") | |
1578 | 1585 | else if ((0 > stoplossFeeWithLoan)) | |
1579 | 1586 | then throw("stoplossFeeWithLoan must be greater than 0") | |
1580 | - | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kAxlyStopLossNoLoanFee), stoplossFeeNoLoan), IntegerEntry((poolAddr + kAxlyStopLossLoanFee), stoplossFeeWithLoan), IntegerEntry((poolAddr + kPoolInterestLoan), 0), IntegerEntry((poolAddr + kPoolInterestNoLoan), 0), StringEntry((kPool + poolAddr), type), StringEntry((shareId + kSharePool), poolAddr), BooleanEntry((poolAddr + kPoolCanBorrow), canBorrow)] | |
1587 | + | else [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((poolAddr + kPoolType), poolType), StringEntry((shareId + kSharePool), poolAddr), BooleanEntry((poolAddr + kPoolCanBorrow), canBorrow)] | |
1581 | 1588 | })) | |
1582 | 1589 | ||
1583 | 1590 | ||
1584 | 1591 | ||
1585 | 1592 | @Callable(i) | |
1586 | 1593 | func updatePoolFees (poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan,stoplossFeeNoLoan,stoplossFeeWithLoan) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if (!(isDefined(getString(this, (kPool + poolAddr))))) | |
1587 | 1594 | then throw(("Can't find pool with addr " + poolAddr)) | |
1588 | 1595 | else if ((0 > inFeeNoLoan)) | |
1589 | 1596 | then throw("inFeeNoLoan must be greater than 0") | |
1590 | 1597 | else if ((0 > inFeeLoan)) | |
1591 | 1598 | then throw("inFeeLoan must be greater than 0") | |
1592 | 1599 | else if ((0 > capFeeNoLoan)) | |
1593 | 1600 | then throw("capFeeNoLoan must be greater than 0") | |
1594 | 1601 | else if ((0 > capFeeWithLoan)) | |
1595 | 1602 | then throw("capFeeWithLoan must be greater than 0") | |
1596 | 1603 | else if ((0 > stoplossFeeNoLoan)) | |
1597 | 1604 | then throw("stoplossFeeNoLoan must be greater than 0") | |
1598 | 1605 | else if ((0 > stoplossFeeWithLoan)) | |
1599 | 1606 | then throw("stoplossFeeWithLoan must be greater than 0") | |
1600 | 1607 | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kAxlyStopLossNoLoanFee), stoplossFeeNoLoan), IntegerEntry((poolAddr + kAxlyStopLossLoanFee), stoplossFeeWithLoan)])) | |
1601 | 1608 | ||
1602 | 1609 | ||
1603 | 1610 | ||
1604 | 1611 | @Callable(i) | |
1605 | 1612 | func activate () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, kActive), true)) | |
1606 | 1613 | then throw("dApp already active") | |
1607 | 1614 | else [BooleanEntry(kActive, true)]) | |
1608 | 1615 | ||
1609 | 1616 | ||
1610 | 1617 | ||
1611 | 1618 | @Callable(i) | |
1612 | 1619 | func shutdown () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, kActive), true))) | |
1613 | 1620 | then throw("dApp already shutdown") | |
1614 | 1621 | else [BooleanEntry(kActive, false)]) | |
1615 | 1622 | ||
1616 | 1623 | ||
1617 | 1624 | ||
1618 | 1625 | @Callable(i) | |
1619 | 1626 | func activateForUsers () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, kActiveUsers), true)) | |
1620 | 1627 | then throw("dApp already active for users") | |
1621 | 1628 | else [BooleanEntry(kActiveUsers, true)]) | |
1622 | 1629 | ||
1623 | 1630 | ||
1624 | 1631 | ||
1625 | 1632 | @Callable(i) | |
1626 | 1633 | func shutdownForUsers () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, kActiveUsers), true))) | |
1627 | 1634 | then throw("dApp already shutdown for users") | |
1628 | 1635 | else [BooleanEntry(kActiveUsers, false)]) | |
1629 | 1636 | ||
1630 | 1637 | ||
1631 | 1638 | ||
1632 | 1639 | @Callable(i) | |
1633 | 1640 | func activateSF () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, (SF_POOL + kActiveSFWX)), true)) | |
1634 | 1641 | then throw("SWOPFI already active") | |
1635 | 1642 | else [BooleanEntry((SF_POOL + kActiveSFWX), true)]) | |
1636 | 1643 | ||
1637 | 1644 | ||
1638 | 1645 | ||
1639 | 1646 | @Callable(i) | |
1640 | 1647 | func shutdownSF () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, (SF_POOL + kActiveSFWX)), true))) | |
1641 | 1648 | then throw("SWOPFI already shutdown") | |
1642 | 1649 | else [BooleanEntry((SF_POOL + kActiveSFWX), false)]) | |
1643 | 1650 | ||
1644 | 1651 | ||
1645 | 1652 | ||
1646 | 1653 | @Callable(i) | |
1647 | 1654 | func activateWX () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, (WX_POOL + kActiveSFWX)), true)) | |
1648 | 1655 | then throw("WX already active") | |
1649 | 1656 | else [BooleanEntry((WX_POOL + kActiveSFWX), true)]) | |
1650 | 1657 | ||
1651 | 1658 | ||
1652 | 1659 | ||
1653 | 1660 | @Callable(i) | |
1654 | 1661 | func shutdownWX () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, (WX_POOL + kActiveSFWX)), true))) | |
1655 | 1662 | then throw("WX already shutdown") | |
1656 | 1663 | else [BooleanEntry((WX_POOL + kActiveSFWX), false)]) | |
1657 | 1664 | ||
1658 | 1665 | ||
1659 | 1666 | ||
1660 | 1667 | @Callable(i) | |
1661 | 1668 | func activatePool (pool) = valueOrElse(isAdminCall(i), if (!(isDefined(getString(this, (kPool + pool))))) | |
1662 | 1669 | then throw("Unknown pool") | |
1663 | 1670 | else if (valueOrElse(getBoolean(this, (pool + kPoolActive)), true)) | |
1664 | 1671 | then throw("Pool already active") | |
1665 | 1672 | else [BooleanEntry((pool + kPoolActive), true)]) | |
1666 | 1673 | ||
1667 | 1674 | ||
1668 | 1675 | ||
1669 | 1676 | @Callable(i) | |
1670 | 1677 | func shutdownPool (pool) = valueOrElse(isAdminCall(i), if (!(isDefined(getString(this, (kPool + pool))))) | |
1671 | 1678 | then throw("Unknown pool") | |
1672 | 1679 | else if (!(valueOrElse(getBoolean(this, (pool + kPoolActive)), true))) | |
1673 | 1680 | then throw("Pool already shutdown") | |
1674 | 1681 | else [BooleanEntry((pool + kPoolActive), false)]) | |
1675 | 1682 | ||
1676 | 1683 |
github/deemru/w8io/026f985 293.83 ms ◑