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