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