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