tx · E4JbTH1etik8Tm6bawmhHKCoR52xS4vkaSTGmzFBSynb 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.22000000 Waves 2023.04.13 17:52 [2532925] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "E4JbTH1etik8Tm6bawmhHKCoR52xS4vkaSTGmzFBSynb", "fee": 22000000, "feeAssetId": null, "timestamp": 1681397519655, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "x3nBtjAKSEfMaAjFQjV1JeCdyFY6yDuYegu8fLu6AbAFkyryFWcczjnN7AC2z66uk2EbPXdARM6AvmZGM59Wrr7" ], "script": "base64:BgJOCAISBQoDCAEIEgMKAQgSBAoCCAESAwoBCBIOCgwICAgBBBEYGBEBARgSCgoICAgIAQQIARgSDgoMCAgIAQQYGBgYGAEYEgcKBQgIAQEBQQAHU0ZfUE9PTAICU0YAB1dYX1BPT0wCAldYAAdDQVBfRkVFAgNjYXAACExPQU5fRkVFAgRsb2FuAAtOT19MT0FOX0ZFRQIGbm9Mb2FuAAZTQ0FMRTgAgMLXLwAHU0NBTEUxMACAyK+gJQAKRkVFX1NDQUxFNgDAhD0AFGtTRlBvb2xBQXNzZXRCYWxhbmNlAg9BX2Fzc2V0X2JhbGFuY2UAFGtTRlBvb2xCQXNzZXRCYWxhbmNlAg9CX2Fzc2V0X2JhbGFuY2UAD2tTRlBvb2xBQXNzZXRJZAIKQV9hc3NldF9pZAAPa1NGUG9vbEJBc3NldElkAgpCX2Fzc2V0X2lkAA5rU0ZQb29sU2hhcmVJZAIOc2hhcmVfYXNzZXRfaWQACmtTRlBvb2xGZWUCCmNvbW1pc3Npb24ADWtVc2VyUG9zaXRpb24CDl91c2VyX3Bvc2l0aW9uABFrVXNlckJvcn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5qJEQbwNfWm9FzAkkd3nFTk Next: GYdffmNVVoYBErKVNcB3yS4uoSchwfGouQ9cwuaPd5QD Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let SF_ | |
4 | + | let SF_POOL = "SF" | |
5 | 5 | ||
6 | - | let WX_ | |
6 | + | let WX_POOL = "WX" | |
7 | 7 | ||
8 | 8 | let CAP_FEE = "cap" | |
9 | 9 | ||
27 | 27 | ||
28 | 28 | let kSFPoolShareId = "share_asset_id" | |
29 | 29 | ||
30 | + | let kSFPoolFee = "commission" | |
31 | + | ||
30 | 32 | let kUserPosition = "_user_position" | |
31 | 33 | ||
32 | 34 | let kUserBorrowAmount = "_user_position_borrow_amount" | |
33 | 35 | ||
34 | 36 | let kUserBorrowAssetId = "_user_position_borrow_asset_id" | |
35 | - | ||
36 | - | let kUserPositionType = "_user_position_type" | |
37 | 37 | ||
38 | 38 | let kUserPositionNum = "_user_position_number" | |
39 | 39 | ||
65 | 65 | ||
66 | 66 | let kPriceOracle = "price_oracle" | |
67 | 67 | ||
68 | - | let kExContract = "exchangeContract" | |
68 | + | let kExContract = "exchange_contract" | |
69 | + | ||
70 | + | let kWxSwapContract = "wx_swap_contract" | |
69 | 71 | ||
70 | 72 | let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address"))) | |
71 | 73 | ||
72 | 74 | let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address"))) | |
73 | 75 | ||
74 | 76 | let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address"))) | |
77 | + | ||
78 | + | let wxSwapContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kWxSwapContract), "No wx swap address"))) | |
75 | 79 | ||
76 | 80 | let SWOPID = base58'4W19ndijcc2CsQa9HGW2dfXKTVXhnneWWttxXrtjPmEp' | |
77 | 81 | ||
123 | 127 | } | |
124 | 128 | ||
125 | 129 | ||
126 | - | func getPoolData (poolAddr,type) = if ((type == SF_ | |
130 | + | func getPoolData (poolAddr,type) = if ((type == SF_POOL)) | |
127 | 131 | then getSFPoolData(poolAddr) | |
128 | - | else if ((type == WX_ | |
132 | + | else if ((type == WX_POOL)) | |
129 | 133 | then getWXPoolData(poolAddr) | |
130 | 134 | else throw("Wrong pool type") | |
131 | 135 | ||
190 | 194 | let poolAddr = Address(fromBase58String(pool)) | |
191 | 195 | let ratioA = fraction(SCALE8, pmtA, balA) | |
192 | 196 | let ratioB = fraction(SCALE8, pmtB, balB) | |
193 | - | let $ | |
197 | + | let $t063976689 = if ((ratioB > ratioA)) | |
194 | 198 | then { | |
195 | 199 | let pmt = fraction(balB, ratioA, SCALE8, CEILING) | |
196 | 200 | $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB) | |
199 | 203 | let pmt = fraction(balA, ratioB, SCALE8, CEILING) | |
200 | 204 | $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA) | |
201 | 205 | } | |
202 | - | let pmtAmountA = $ | |
203 | - | let pmtAmountB = $ | |
204 | - | let change = $ | |
205 | - | let changeAssetId = $ | |
206 | + | let pmtAmountA = $t063976689._1 | |
207 | + | let pmtAmountB = $t063976689._2 | |
208 | + | let change = $t063976689._3 | |
209 | + | let changeAssetId = $t063976689._4 | |
206 | 210 | let inv1 = if (if ((pmtAmountA > 0)) | |
207 | 211 | then (pmtAmountB > 0) | |
208 | 212 | else false) | |
245 | 249 | ||
246 | 250 | func replenishWX (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,shareId) = { | |
247 | 251 | let poolAddr = Address(fromBase58String(pool)) | |
248 | - | let $ | |
252 | + | let $t081408989 = if (if ((pmtA > 0)) | |
249 | 253 | then (pmtB > 0) | |
250 | 254 | else false) | |
251 | 255 | then { | |
286 | 290 | else if ((pmtB > 0)) | |
287 | 291 | then $Tuple4(pmtA, pmtB, pmtB, pmtAssetB) | |
288 | 292 | else throw("pmts must be > 0") | |
289 | - | let pmtAmountA = $ | |
290 | - | let pmtAmountB = $ | |
291 | - | let change = $ | |
292 | - | let changeAssetId = $ | |
293 | + | let pmtAmountA = $t081408989._1 | |
294 | + | let pmtAmountB = $t081408989._2 | |
295 | + | let change = $t081408989._3 | |
296 | + | let changeAssetId = $t081408989._4 | |
293 | 297 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
294 | 298 | if ((shareBalanceBefore == shareBalanceBefore)) | |
295 | 299 | then { | |
335 | 339 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type) = { | |
336 | 340 | let totalAmount = getPoolTotalShare(pool) | |
337 | 341 | let curPoolInterest = getIntegerValue(this, (pool + kPoolInterest)) | |
338 | - | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount | |
342 | + | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), IntegerEntry((((pool + "_") + user) + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
339 | 343 | } | |
340 | 344 | ||
341 | 345 | ||
342 | - | func claimFarmed (type,pool) = if ((type == SF_ | |
346 | + | func claimFarmed (type,pool) = if ((type == SF_POOL)) | |
343 | 347 | then { | |
344 | 348 | let balBefore = accountBalance(SWOPID) | |
345 | 349 | if ((balBefore == balBefore)) | |
354 | 358 | } | |
355 | 359 | else throw("Strict value is not equal to itself.") | |
356 | 360 | } | |
357 | - | else if ((type == WX_ | |
361 | + | else if ((type == WX_POOL)) | |
358 | 362 | then { | |
359 | 363 | let balBefore = accountBalance(WXID) | |
360 | 364 | if ((balBefore == balBefore)) | |
413 | 417 | ||
414 | 418 | func capitalize (pool,type,tokenId,tokenAmount) = { | |
415 | 419 | let poolAddr = Address(fromBase58String(pool)) | |
416 | - | let $ | |
417 | - | let AId = $ | |
418 | - | let BId = $ | |
419 | - | let balA = $ | |
420 | - | let balB = $ | |
421 | - | let shareId = $ | |
422 | - | let $ | |
420 | + | let $t01319013268 = getPoolData(poolAddr, type) | |
421 | + | let AId = $t01319013268._1 | |
422 | + | let BId = $t01319013268._2 | |
423 | + | let balA = $t01319013268._3 | |
424 | + | let balB = $t01319013268._4 | |
425 | + | let shareId = $t01319013268._5 | |
426 | + | let $t01327113351 = if ((tokenId == AId)) | |
423 | 427 | then $Tuple2(tokenAmount, 0) | |
424 | 428 | else $Tuple2(0, tokenAmount) | |
425 | - | let pmtA = $ | |
426 | - | let pmtB = $ | |
427 | - | let $ | |
429 | + | let pmtA = $t01327113351._1 | |
430 | + | let pmtB = $t01327113351._2 | |
431 | + | let $t01335413715 = if ((type == SF_POOL)) | |
428 | 432 | then replenishSwopFi(pool, CAP_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
429 | 433 | else replenishWX(pool, CAP_FEE, pmtA, AId, pmtB, BId, shareId) | |
430 | - | let stakedAmount = $ | |
431 | - | let axlyFee = $ | |
434 | + | let stakedAmount = $t01335413715._1 | |
435 | + | let axlyFee = $t01335413715._2 | |
432 | 436 | let curPoolInterest = valueOrElse(getInteger(this, (pool + kPoolInterest)), 0) | |
433 | 437 | let totalShareAmount = getPoolTotalShare(pool) | |
434 | 438 | let newInterest = (curPoolInterest + fraction(stakedAmount, SCALE10, totalShareAmount)) | |
435 | 439 | [IntegerEntry((pool + kPoolInterest), newInterest), ScriptTransfer(moneyBox, axlyFee, fromBase58String(shareId))] | |
436 | 440 | } | |
441 | + | ||
442 | + | ||
443 | + | func exchangeDirectlySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
444 | + | let poolAddr = Address(fromBase58String(pool)) | |
445 | + | let feeScale6 = 1000000 | |
446 | + | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
447 | + | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee)) | |
448 | + | let $t01440814696 = if ((assetTokenToGet == assetIdA)) | |
449 | + | then { | |
450 | + | let amountToPay = fraction(balA, amntGetNoFee, (balB - amntGetNoFee)) | |
451 | + | $Tuple2(amountToPay, assetIdB) | |
452 | + | } | |
453 | + | else { | |
454 | + | let amountToPay = fraction(balB, amntGetNoFee, (balA - amntGetNoFee)) | |
455 | + | $Tuple2(amountToPay, assetIdA) | |
456 | + | } | |
457 | + | let amountToPay = $t01440814696._1 | |
458 | + | let assetToPay = $t01440814696._2 | |
459 | + | invoke(poolAddr, "callFunction", ["exchange", "1"], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
460 | + | } | |
461 | + | ||
462 | + | ||
463 | + | func exchangeDirectlyWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
464 | + | let poolAddr = Address(fromBase58String(pool)) | |
465 | + | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
466 | + | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
467 | + | let feeScale = toBigInt(100000000) | |
468 | + | let $t01517315481 = if ((assetTokenToGet == assetIdA)) | |
469 | + | then { | |
470 | + | let amountToPay = fraction(balA, amountTokenToGet, (balB - amountTokenToGet)) | |
471 | + | $Tuple2(amountToPay, assetIdB) | |
472 | + | } | |
473 | + | else { | |
474 | + | let amountToPay = fraction(balB, amountTokenToGet, (balA - amountTokenToGet)) | |
475 | + | $Tuple2(amountToPay, assetIdA) | |
476 | + | } | |
477 | + | let amountToPay = $t01517315481._1 | |
478 | + | let assetToPay = $t01517315481._2 | |
479 | + | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))))) | |
480 | + | invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPayWithFee)]) | |
481 | + | } | |
482 | + | ||
483 | + | ||
484 | + | func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL)) | |
485 | + | then exchangeDirectlySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
486 | + | else exchangeDirectlyWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
437 | 487 | ||
438 | 488 | ||
439 | 489 | @Callable(i) | |
443 | 493 | then throw("Leverage can't be <100 and >300") | |
444 | 494 | else { | |
445 | 495 | let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
446 | - | let $ | |
447 | - | let AId = $ | |
448 | - | let BId = $ | |
449 | - | let balA = $ | |
450 | - | let balB = $ | |
451 | - | let shareId = $ | |
452 | - | let $ | |
496 | + | let $t01638216471 = getPoolData(Address(fromBase58String(pool)), type) | |
497 | + | let AId = $t01638216471._1 | |
498 | + | let BId = $t01638216471._2 | |
499 | + | let balA = $t01638216471._3 | |
500 | + | let balB = $t01638216471._4 | |
501 | + | let shareId = $t01638216471._5 | |
502 | + | let $t01647417111 = if ((size(i.payments) == 2)) | |
453 | 503 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
454 | 504 | then throw("Wrong payment asset A") | |
455 | 505 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
462 | 512 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
463 | 513 | else throw("Wrong payment") | |
464 | 514 | else throw("One or two payments expected") | |
465 | - | let pmtA = $ | |
466 | - | let pmtAssetA = $ | |
467 | - | let pmtB = $ | |
468 | - | let pmtAssetB = $ | |
515 | + | let pmtA = $t01647417111._1 | |
516 | + | let pmtAssetA = $t01647417111._2 | |
517 | + | let pmtB = $t01647417111._3 | |
518 | + | let pmtAssetB = $t01647417111._4 | |
469 | 519 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
470 | 520 | if ((leverage > 100)) | |
471 | 521 | then { | |
484 | 534 | let @ = invoke(this, "createNewRequest", [request], nil) | |
485 | 535 | if ($isInstanceOf(@, "Int")) | |
486 | 536 | then @ | |
487 | - | else | |
537 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
488 | 538 | } | |
489 | 539 | if ((newRequestId == newRequestId)) | |
490 | 540 | then { | |
497 | 547 | else throw("Strict value is not equal to itself.") | |
498 | 548 | } | |
499 | 549 | else { | |
500 | - | let $ | |
550 | + | let $t01845218843 = if ((type == SF_POOL)) | |
501 | 551 | then replenishSwopFi(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, balA, balB, shareId) | |
502 | 552 | else replenishWX(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, shareId) | |
503 | - | let userStaked = $ | |
504 | - | let axlyFee = $ | |
553 | + | let userStaked = $t01845218843._1 | |
554 | + | let axlyFee = $t01845218843._2 | |
505 | 555 | replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, type) | |
506 | 556 | } | |
507 | 557 | } | |
528 | 578 | let user = request[1] | |
529 | 579 | let shareId = request[9] | |
530 | 580 | let posNum = parseIntValue(request[12]) | |
531 | - | let $ | |
581 | + | let $t01980120316 = if ((request[0] == SF_POOL)) | |
532 | 582 | then replenishSwopFi(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], parseIntValue(request[7]), parseIntValue(request[8]), shareId) | |
533 | - | else if ((request[0] == WX_ | |
583 | + | else if ((request[0] == WX_POOL)) | |
534 | 584 | then replenishWX(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], shareId) | |
535 | 585 | else throw("Wrong request type") | |
536 | - | let userStaked = $ | |
537 | - | let axlyFee = $ | |
586 | + | let userStaked = $t01980120316._1 | |
587 | + | let axlyFee = $t01980120316._2 | |
538 | 588 | let borrowEntries = [IntegerEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAmount), i.payments[0].amount), StringEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAssetId), request[10])] | |
539 | 589 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, request[0]) | |
540 | 590 | $Tuple2(((entries ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
546 | 596 | @Callable(i) | |
547 | 597 | func withdraw (pool,posId) = { | |
548 | 598 | let user = toString(i.caller) | |
549 | - | let pType = valueOrErrorMessage(getString(this, ( | |
550 | - | let pAmount = | |
599 | + | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
600 | + | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), "Unknown position") | |
551 | 601 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)) | |
552 | 602 | let poolInterst = getIntegerValue(this, (pool + kPoolInterest)) | |
553 | - | let poolTotalShare = | |
603 | + | let poolTotalShare = getPoolTotalShare(pool) | |
554 | 604 | let userCanWithdraw = (pAmount + fraction(pAmount, (poolInterst - userInterest), SCALE10)) | |
555 | 605 | let poolAddr = Address(fromBase58String(pool)) | |
556 | 606 | let userAddr = Address(fromBase58String(user)) | |
557 | 607 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAmount)) | |
558 | 608 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAssetId)) | |
559 | - | let $ | |
560 | - | let assetIdA = $ | |
561 | - | let assetIdB = $ | |
562 | - | let balA = $ | |
563 | - | let balB = $ | |
564 | - | let shareId = $ | |
609 | + | let $t02166221762 = getPoolData(Address(fromBase58String(pool)), pType) | |
610 | + | let assetIdA = $t02166221762._1 | |
611 | + | let assetIdB = $t02166221762._2 | |
612 | + | let balA = $t02166221762._3 | |
613 | + | let balB = $t02166221762._4 | |
614 | + | let shareId = $t02166221762._5 | |
565 | 615 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
566 | 616 | if ((cBalABefore == cBalABefore)) | |
567 | 617 | then { | |
568 | 618 | let cBalBBefore = accountBalance(assetIdFromStr(assetIdB)) | |
569 | 619 | if ((cBalBBefore == cBalBBefore)) | |
570 | 620 | then { | |
571 | - | let inv = if ((pType == SF_ | |
621 | + | let inv = if ((pType == SF_POOL)) | |
572 | 622 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
573 | - | else if ((pType == WX_ | |
623 | + | else if ((pType == WX_POOL)) | |
574 | 624 | then invoke(poolAddr, "unstakeAndGet", [userCanWithdraw], nil) | |
575 | 625 | else throw("Wrong position type") | |
576 | 626 | if ((inv == inv)) | |
577 | 627 | then { | |
578 | 628 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
579 | 629 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
580 | - | let $t02033320422 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
581 | - | let tokensAmountA = $t02033320422._1 | |
582 | - | let tokensAmountB = $t02033320422._2 | |
583 | - | [DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionType)), DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, tokensAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, tokensAmountB, assetIdFromStr(assetIdB))] | |
630 | + | let $t02227422363 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
631 | + | let tokensAmountA = $t02227422363._1 | |
632 | + | let tokensAmountB = $t02227422363._2 | |
633 | + | let $t02236623358 = if ((borrowAmount > 0)) | |
634 | + | then { | |
635 | + | let debt = { | |
636 | + | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((((pool + "_") + user) + "_") + toString(posId)), borrowAsset], nil) | |
637 | + | if ($isInstanceOf(@, "Int")) | |
638 | + | then @ | |
639 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
640 | + | } | |
641 | + | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
642 | + | then (debt > tokensAmountA) | |
643 | + | else false) | |
644 | + | then (debt - tokensAmountA) | |
645 | + | else if (if ((borrowAsset == assetIdB)) | |
646 | + | then (debt > tokensAmountB) | |
647 | + | else false) | |
648 | + | then (debt - tokensAmountB) | |
649 | + | else 0 | |
650 | + | let exInv = if ((amountToGetEx > 0)) | |
651 | + | then exchangeDirectly(pType, pool, assetIdA, assetIdB, balA, balB, amountToGetEx, borrowAsset) | |
652 | + | else 0 | |
653 | + | if ((exInv == exInv)) | |
654 | + | then { | |
655 | + | let closeDbtInv = invoke(getLendSrvAddr(), "repay", [((user + "_") + toString(posId))], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
656 | + | if ((closeDbtInv == closeDbtInv)) | |
657 | + | then { | |
658 | + | let cBalAAfterRepay = accountBalance(assetIdFromStr(assetIdA)) | |
659 | + | let cBalBAfterRepay = accountBalance(assetIdFromStr(assetIdB)) | |
660 | + | $Tuple2((cBalAAfterRepay - cBalABefore), (cBalBAfterRepay - cBalBBefore)) | |
661 | + | } | |
662 | + | else throw("Strict value is not equal to itself.") | |
663 | + | } | |
664 | + | else throw("Strict value is not equal to itself.") | |
665 | + | } | |
666 | + | else $Tuple2(tokensAmountA, tokensAmountB) | |
667 | + | let toUserAmountA = $t02236623358._1 | |
668 | + | let toUserAmountB = $t02236623358._2 | |
669 | + | [DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, tokensAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, tokensAmountB, assetIdFromStr(assetIdB))] | |
584 | 670 | } | |
585 | 671 | else throw("Strict value is not equal to itself.") | |
586 | 672 | } | |
601 | 687 | ||
602 | 688 | @Callable(i) | |
603 | 689 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
604 | - | let $ | |
690 | + | let $t02446724661 = if (claim) | |
605 | 691 | then claimFarmed(type, pool) | |
606 | 692 | else { | |
607 | - | let claimedAsset = if ((type == SF_ | |
693 | + | let claimedAsset = if ((type == SF_POOL)) | |
608 | 694 | then SWOPID | |
609 | 695 | else WXID | |
610 | 696 | $Tuple2(amountToExchange, claimedAsset) | |
611 | 697 | } | |
612 | - | let claimedAmount = $ | |
613 | - | let claimedAsset = $ | |
698 | + | let claimedAmount = $t02446724661._1 | |
699 | + | let claimedAsset = $t02446724661._2 | |
614 | 700 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
615 | 701 | let change = (claimedAmount - amountToExchange) | |
616 | 702 | let changeEntry = if ((change > 0)) | |
623 | 709 | ||
624 | 710 | @Callable(i) | |
625 | 711 | func capitalizeExPazzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
626 | - | let $ | |
712 | + | let $t02531725511 = if (claim) | |
627 | 713 | then claimFarmed(type, pool) | |
628 | 714 | else { | |
629 | - | let claimedAsset = if ((type == SF_ | |
715 | + | let claimedAsset = if ((type == SF_POOL)) | |
630 | 716 | then SWOPID | |
631 | 717 | else WXID | |
632 | 718 | $Tuple2(amountToExchange, claimedAsset) | |
633 | 719 | } | |
634 | - | let claimedAmount = $ | |
635 | - | let claimedAsset = $ | |
720 | + | let claimedAmount = $t02531725511._1 | |
721 | + | let claimedAsset = $t02531725511._2 | |
636 | 722 | let exchangedAmount = exchangePazzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
637 | 723 | let change = (claimedAmount - amountToExchange) | |
638 | 724 | let changeEntry = if ((change > 0)) | |
645 | 731 | ||
646 | 732 | @Callable(i) | |
647 | 733 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
648 | - | let $ | |
734 | + | let $t02623426428 = if (claim) | |
649 | 735 | then claimFarmed(type, pool) | |
650 | 736 | else { | |
651 | - | let claimedAsset = if ((type == SF_ | |
737 | + | let claimedAsset = if ((type == SF_POOL)) | |
652 | 738 | then SWOPID | |
653 | 739 | else WXID | |
654 | 740 | $Tuple2(amountToExchange, claimedAsset) | |
655 | 741 | } | |
656 | - | let claimedAmount = $ | |
657 | - | let claimedAsset = $ | |
742 | + | let claimedAmount = $t02623426428._1 | |
743 | + | let claimedAsset = $t02623426428._2 | |
658 | 744 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
659 | 745 | let change = (claimedAmount - amountToExchange) | |
660 | 746 | let changeEntry = if ((change > 0)) | |
666 | 752 | ||
667 | 753 | ||
668 | 754 | @Callable(i) | |
669 | - | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFee) = if (if ((type != SF_ | |
670 | - | then (type != WX_ | |
755 | + | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFee) = if (if ((type != SF_POOL)) | |
756 | + | then (type != WX_POOL) | |
671 | 757 | else false) | |
672 | 758 | then throw("Wrong type") | |
673 | 759 | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), IntegerEntry((poolAddr + kPoolInterest), 0), StringEntry((kPool + poolAddr), type)] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let SF_ | |
4 | + | let SF_POOL = "SF" | |
5 | 5 | ||
6 | - | let WX_ | |
6 | + | let WX_POOL = "WX" | |
7 | 7 | ||
8 | 8 | let CAP_FEE = "cap" | |
9 | 9 | ||
10 | 10 | let LOAN_FEE = "loan" | |
11 | 11 | ||
12 | 12 | let NO_LOAN_FEE = "noLoan" | |
13 | 13 | ||
14 | 14 | let SCALE8 = 100000000 | |
15 | 15 | ||
16 | 16 | let SCALE10 = 10000000000 | |
17 | 17 | ||
18 | 18 | let FEE_SCALE6 = 1000000 | |
19 | 19 | ||
20 | 20 | let kSFPoolAAssetBalance = "A_asset_balance" | |
21 | 21 | ||
22 | 22 | let kSFPoolBAssetBalance = "B_asset_balance" | |
23 | 23 | ||
24 | 24 | let kSFPoolAAssetId = "A_asset_id" | |
25 | 25 | ||
26 | 26 | let kSFPoolBAssetId = "B_asset_id" | |
27 | 27 | ||
28 | 28 | let kSFPoolShareId = "share_asset_id" | |
29 | 29 | ||
30 | + | let kSFPoolFee = "commission" | |
31 | + | ||
30 | 32 | let kUserPosition = "_user_position" | |
31 | 33 | ||
32 | 34 | let kUserBorrowAmount = "_user_position_borrow_amount" | |
33 | 35 | ||
34 | 36 | let kUserBorrowAssetId = "_user_position_borrow_asset_id" | |
35 | - | ||
36 | - | let kUserPositionType = "_user_position_type" | |
37 | 37 | ||
38 | 38 | let kUserPositionNum = "_user_position_number" | |
39 | 39 | ||
40 | 40 | let kUserPositionInterest = "_user_position_interest" | |
41 | 41 | ||
42 | 42 | let kPoolTotal = "_pool_total" | |
43 | 43 | ||
44 | 44 | let kPoolInterest = "_pool_interest" | |
45 | 45 | ||
46 | 46 | let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan" | |
47 | 47 | ||
48 | 48 | let kAxlyInFeeWithLoan = "_axly_fee_with_loan" | |
49 | 49 | ||
50 | 50 | let kAxlyCapFee = "_axly_fee_cap" | |
51 | 51 | ||
52 | 52 | let kRequestId = "_request_id" | |
53 | 53 | ||
54 | 54 | let kRequestIter = "requests_iter" | |
55 | 55 | ||
56 | 56 | let kPool = "pool_" | |
57 | 57 | ||
58 | 58 | let kPoolCapChange = "_pool_cap_change" | |
59 | 59 | ||
60 | 60 | let kMoneyBox = "axly_money_box" | |
61 | 61 | ||
62 | 62 | let kSFFarmingAddr = "swopfi_farming_addr" | |
63 | 63 | ||
64 | 64 | let kLendService = "lend_service_addr" | |
65 | 65 | ||
66 | 66 | let kPriceOracle = "price_oracle" | |
67 | 67 | ||
68 | - | let kExContract = "exchangeContract" | |
68 | + | let kExContract = "exchange_contract" | |
69 | + | ||
70 | + | let kWxSwapContract = "wx_swap_contract" | |
69 | 71 | ||
70 | 72 | let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address"))) | |
71 | 73 | ||
72 | 74 | let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address"))) | |
73 | 75 | ||
74 | 76 | let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address"))) | |
77 | + | ||
78 | + | let wxSwapContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kWxSwapContract), "No wx swap address"))) | |
75 | 79 | ||
76 | 80 | let SWOPID = base58'4W19ndijcc2CsQa9HGW2dfXKTVXhnneWWttxXrtjPmEp' | |
77 | 81 | ||
78 | 82 | let WXID = base58'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc' | |
79 | 83 | ||
80 | 84 | func isSelfCall (i) = if ((i.caller == this)) | |
81 | 85 | then unit | |
82 | 86 | else throw("Only contract itself can call this function") | |
83 | 87 | ||
84 | 88 | ||
85 | 89 | func accountBalance (assetId) = match assetId { | |
86 | 90 | case id: ByteVector => | |
87 | 91 | assetBalance(this, id) | |
88 | 92 | case waves: Unit => | |
89 | 93 | wavesBalance(this).available | |
90 | 94 | case _ => | |
91 | 95 | throw("Match error") | |
92 | 96 | } | |
93 | 97 | ||
94 | 98 | ||
95 | 99 | 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")) | |
96 | 100 | ||
97 | 101 | ||
98 | 102 | func getWXPoolData (poolAddr) = { | |
99 | 103 | let cfg = { | |
100 | 104 | let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil) | |
101 | 105 | if ($isInstanceOf(@, "List[Any]")) | |
102 | 106 | then @ | |
103 | 107 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
104 | 108 | } | |
105 | 109 | if ((cfg == cfg)) | |
106 | 110 | then $Tuple5(valueOrErrorMessage({ | |
107 | 111 | let @ = cfg[4] | |
108 | 112 | if ($isInstanceOf(@, "String")) | |
109 | 113 | then @ | |
110 | 114 | else unit | |
111 | 115 | }, "Can't get pool A asset id"), valueOrErrorMessage({ | |
112 | 116 | let @ = cfg[5] | |
113 | 117 | if ($isInstanceOf(@, "String")) | |
114 | 118 | then @ | |
115 | 119 | else unit | |
116 | 120 | }, "Can't get pool B asset id"), 0, 0, valueOrErrorMessage({ | |
117 | 121 | let @ = cfg[3] | |
118 | 122 | if ($isInstanceOf(@, "String")) | |
119 | 123 | then @ | |
120 | 124 | else unit | |
121 | 125 | }, "Can't get pool LP asset id")) | |
122 | 126 | else throw("Strict value is not equal to itself.") | |
123 | 127 | } | |
124 | 128 | ||
125 | 129 | ||
126 | - | func getPoolData (poolAddr,type) = if ((type == SF_ | |
130 | + | func getPoolData (poolAddr,type) = if ((type == SF_POOL)) | |
127 | 131 | then getSFPoolData(poolAddr) | |
128 | - | else if ((type == WX_ | |
132 | + | else if ((type == WX_POOL)) | |
129 | 133 | then getWXPoolData(poolAddr) | |
130 | 134 | else throw("Wrong pool type") | |
131 | 135 | ||
132 | 136 | ||
133 | 137 | func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0) | |
134 | 138 | ||
135 | 139 | ||
136 | 140 | func getNewUserPositionNumber (pool,user) = (valueOrElse(getInteger(this, (((pool + "_") + user) + kUserPositionNum)), 0) + 1) | |
137 | 141 | ||
138 | 142 | ||
139 | 143 | func getAxlyFee (pool,feeType) = if ((feeType == "cap")) | |
140 | 144 | then getIntegerValue(this, (pool + kAxlyCapFee)) | |
141 | 145 | else if ((feeType == "loan")) | |
142 | 146 | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
143 | 147 | else if ((feeType == "noLoan")) | |
144 | 148 | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
145 | 149 | else throw("Wrong fee type") | |
146 | 150 | ||
147 | 151 | ||
148 | 152 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
149 | 153 | ||
150 | 154 | ||
151 | 155 | func getWXFarmingAddr (poolAddr) = { | |
152 | 156 | let fContract = Address(fromBase58String(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
153 | 157 | let factroyCfg = split(valueOrErrorMessage(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
154 | 158 | Address(fromBase58String(factroyCfg[1])) | |
155 | 159 | } | |
156 | 160 | ||
157 | 161 | ||
158 | 162 | func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr"))) | |
159 | 163 | ||
160 | 164 | ||
161 | 165 | func assetIdToStr (assetId) = match assetId { | |
162 | 166 | case id: ByteVector => | |
163 | 167 | toBase58String(id) | |
164 | 168 | case waves: Unit => | |
165 | 169 | "WAVES" | |
166 | 170 | case _ => | |
167 | 171 | throw("Match error") | |
168 | 172 | } | |
169 | 173 | ||
170 | 174 | ||
171 | 175 | func assetIdFromStr (assetId) = if ((assetId == "WAVES")) | |
172 | 176 | then unit | |
173 | 177 | else fromBase58String(assetId) | |
174 | 178 | ||
175 | 179 | ||
176 | 180 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
177 | 181 | then 8 | |
178 | 182 | else match assetInfo(fromBase58String(assetId)) { | |
179 | 183 | case asset: Asset => | |
180 | 184 | asset.decimals | |
181 | 185 | case _ => | |
182 | 186 | throw("Can't find asset") | |
183 | 187 | } | |
184 | 188 | ||
185 | 189 | ||
186 | 190 | func replenishSwopFi (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,balA,balB,shareId) = { | |
187 | 191 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
188 | 192 | if ((shareBalanceBefore == shareBalanceBefore)) | |
189 | 193 | then { | |
190 | 194 | let poolAddr = Address(fromBase58String(pool)) | |
191 | 195 | let ratioA = fraction(SCALE8, pmtA, balA) | |
192 | 196 | let ratioB = fraction(SCALE8, pmtB, balB) | |
193 | - | let $ | |
197 | + | let $t063976689 = if ((ratioB > ratioA)) | |
194 | 198 | then { | |
195 | 199 | let pmt = fraction(balB, ratioA, SCALE8, CEILING) | |
196 | 200 | $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB) | |
197 | 201 | } | |
198 | 202 | else { | |
199 | 203 | let pmt = fraction(balA, ratioB, SCALE8, CEILING) | |
200 | 204 | $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA) | |
201 | 205 | } | |
202 | - | let pmtAmountA = $ | |
203 | - | let pmtAmountB = $ | |
204 | - | let change = $ | |
205 | - | let changeAssetId = $ | |
206 | + | let pmtAmountA = $t063976689._1 | |
207 | + | let pmtAmountB = $t063976689._2 | |
208 | + | let change = $t063976689._3 | |
209 | + | let changeAssetId = $t063976689._4 | |
206 | 210 | let inv1 = if (if ((pmtAmountA > 0)) | |
207 | 211 | then (pmtAmountB > 0) | |
208 | 212 | else false) | |
209 | 213 | then { | |
210 | 214 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
211 | 215 | invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
212 | 216 | } | |
213 | 217 | else 0 | |
214 | 218 | if ((inv1 == inv1)) | |
215 | 219 | then { | |
216 | 220 | let inv2 = if ((change > 0)) | |
217 | 221 | then { | |
218 | 222 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
219 | 223 | let vars = ["0", "false", "0"] | |
220 | 224 | invoke(poolAddr, "callFunction", ["replenishWithOneToken", vars], payments) | |
221 | 225 | } | |
222 | 226 | else 0 | |
223 | 227 | if ((inv2 == inv2)) | |
224 | 228 | then { | |
225 | 229 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
226 | 230 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
227 | 231 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
228 | 232 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
229 | 233 | if ((0 >= userShareForStake)) | |
230 | 234 | then throw("amount of staked sharetokens must be > 0") | |
231 | 235 | else { | |
232 | 236 | let inv3 = invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
233 | 237 | if ((inv3 == inv3)) | |
234 | 238 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
235 | 239 | else throw("Strict value is not equal to itself.") | |
236 | 240 | } | |
237 | 241 | } | |
238 | 242 | else throw("Strict value is not equal to itself.") | |
239 | 243 | } | |
240 | 244 | else throw("Strict value is not equal to itself.") | |
241 | 245 | } | |
242 | 246 | else throw("Strict value is not equal to itself.") | |
243 | 247 | } | |
244 | 248 | ||
245 | 249 | ||
246 | 250 | func replenishWX (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,shareId) = { | |
247 | 251 | let poolAddr = Address(fromBase58String(pool)) | |
248 | - | let $ | |
252 | + | let $t081408989 = if (if ((pmtA > 0)) | |
249 | 253 | then (pmtB > 0) | |
250 | 254 | else false) | |
251 | 255 | then { | |
252 | 256 | let evalPutInA = split({ | |
253 | 257 | let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil) | |
254 | 258 | if ($isInstanceOf(@, "String")) | |
255 | 259 | then @ | |
256 | 260 | else throw(($getType(@) + " couldn't be cast to String")) | |
257 | 261 | }, "__") | |
258 | 262 | if ((evalPutInA == evalPutInA)) | |
259 | 263 | then { | |
260 | 264 | let evalPutInB = split({ | |
261 | 265 | let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil) | |
262 | 266 | if ($isInstanceOf(@, "String")) | |
263 | 267 | then @ | |
264 | 268 | else throw(($getType(@) + " couldn't be cast to String")) | |
265 | 269 | }, "__") | |
266 | 270 | if ((evalPutInB == evalPutInB)) | |
267 | 271 | then { | |
268 | 272 | let lpInA = parseIntValue(evalPutInA[1]) | |
269 | 273 | let lpInB = parseIntValue(evalPutInB[1]) | |
270 | 274 | if ((lpInB > lpInA)) | |
271 | 275 | then { | |
272 | 276 | let pmtInB = parseIntValue(evalPutInA[8]) | |
273 | 277 | $Tuple4(pmtA, pmtInB, (pmtB - pmtInB), pmtAssetB) | |
274 | 278 | } | |
275 | 279 | else { | |
276 | 280 | let pmtInA = parseIntValue(evalPutInB[7]) | |
277 | 281 | $Tuple4(pmtInA, pmtB, (pmtA - pmtInA), pmtAssetA) | |
278 | 282 | } | |
279 | 283 | } | |
280 | 284 | else throw("Strict value is not equal to itself.") | |
281 | 285 | } | |
282 | 286 | else throw("Strict value is not equal to itself.") | |
283 | 287 | } | |
284 | 288 | else if ((pmtA > 0)) | |
285 | 289 | then $Tuple4(pmtA, pmtB, pmtA, pmtAssetA) | |
286 | 290 | else if ((pmtB > 0)) | |
287 | 291 | then $Tuple4(pmtA, pmtB, pmtB, pmtAssetB) | |
288 | 292 | else throw("pmts must be > 0") | |
289 | - | let pmtAmountA = $ | |
290 | - | let pmtAmountB = $ | |
291 | - | let change = $ | |
292 | - | let changeAssetId = $ | |
293 | + | let pmtAmountA = $t081408989._1 | |
294 | + | let pmtAmountB = $t081408989._2 | |
295 | + | let change = $t081408989._3 | |
296 | + | let changeAssetId = $t081408989._4 | |
293 | 297 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
294 | 298 | if ((shareBalanceBefore == shareBalanceBefore)) | |
295 | 299 | then { | |
296 | 300 | let inv1 = if (if ((pmtAmountA > 0)) | |
297 | 301 | then (pmtAmountB > 0) | |
298 | 302 | else false) | |
299 | 303 | then { | |
300 | 304 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
301 | 305 | invoke(poolAddr, "put", [1000000, false], payments) | |
302 | 306 | } | |
303 | 307 | else 0 | |
304 | 308 | if ((inv1 == inv1)) | |
305 | 309 | then { | |
306 | 310 | let inv2 = if ((change > 0)) | |
307 | 311 | then { | |
308 | 312 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
309 | 313 | invoke(poolAddr, "putOneTkn", [0, false], payments) | |
310 | 314 | } | |
311 | 315 | else 0 | |
312 | 316 | if ((inv2 == inv2)) | |
313 | 317 | then { | |
314 | 318 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
315 | 319 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
316 | 320 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
317 | 321 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
318 | 322 | if ((0 >= userShareForStake)) | |
319 | 323 | then throw("amount of staked sharetokens must be > 0") | |
320 | 324 | else { | |
321 | 325 | let inv3 = invoke(getWXFarmingAddr(poolAddr), "stake", nil, [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
322 | 326 | if ((inv3 == inv3)) | |
323 | 327 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
324 | 328 | else throw("Strict value is not equal to itself.") | |
325 | 329 | } | |
326 | 330 | } | |
327 | 331 | else throw("Strict value is not equal to itself.") | |
328 | 332 | } | |
329 | 333 | else throw("Strict value is not equal to itself.") | |
330 | 334 | } | |
331 | 335 | else throw("Strict value is not equal to itself.") | |
332 | 336 | } | |
333 | 337 | ||
334 | 338 | ||
335 | 339 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type) = { | |
336 | 340 | let totalAmount = getPoolTotalShare(pool) | |
337 | 341 | let curPoolInterest = getIntegerValue(this, (pool + kPoolInterest)) | |
338 | - | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount | |
342 | + | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), IntegerEntry((((pool + "_") + user) + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
339 | 343 | } | |
340 | 344 | ||
341 | 345 | ||
342 | - | func claimFarmed (type,pool) = if ((type == SF_ | |
346 | + | func claimFarmed (type,pool) = if ((type == SF_POOL)) | |
343 | 347 | then { | |
344 | 348 | let balBefore = accountBalance(SWOPID) | |
345 | 349 | if ((balBefore == balBefore)) | |
346 | 350 | then { | |
347 | 351 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
348 | 352 | if ((inv == inv)) | |
349 | 353 | then { | |
350 | 354 | let balAfter = accountBalance(SWOPID) | |
351 | 355 | $Tuple2((balAfter - balBefore), SWOPID) | |
352 | 356 | } | |
353 | 357 | else throw("Strict value is not equal to itself.") | |
354 | 358 | } | |
355 | 359 | else throw("Strict value is not equal to itself.") | |
356 | 360 | } | |
357 | - | else if ((type == WX_ | |
361 | + | else if ((type == WX_POOL)) | |
358 | 362 | then { | |
359 | 363 | let balBefore = accountBalance(WXID) | |
360 | 364 | if ((balBefore == balBefore)) | |
361 | 365 | then { | |
362 | 366 | let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil) | |
363 | 367 | if ((inv == inv)) | |
364 | 368 | then { | |
365 | 369 | let balAfter = accountBalance(WXID) | |
366 | 370 | $Tuple2((balAfter - balBefore), WXID) | |
367 | 371 | } | |
368 | 372 | else throw("Strict value is not equal to itself.") | |
369 | 373 | } | |
370 | 374 | else throw("Strict value is not equal to itself.") | |
371 | 375 | } | |
372 | 376 | else throw("Wrong pool type") | |
373 | 377 | ||
374 | 378 | ||
375 | 379 | func exchangeKeeper (toToken,pmtAmount,pmtAsset,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
376 | 380 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
377 | 381 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
378 | 382 | then { | |
379 | 383 | let inv = invoke(exContract, "swap", [amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
380 | 384 | if ((inv == inv)) | |
381 | 385 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
382 | 386 | else throw("Strict value is not equal to itself.") | |
383 | 387 | } | |
384 | 388 | else throw("Strict value is not equal to itself.") | |
385 | 389 | } | |
386 | 390 | ||
387 | 391 | ||
388 | 392 | func exchangePazzle (toToken,pmtAmount,pmtAsset,routesStr,minToReceive,options) = { | |
389 | 393 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
390 | 394 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
391 | 395 | then { | |
392 | 396 | let inv = invoke(exContract, "puzzleSwap", [routesStr, minToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
393 | 397 | if ((inv == inv)) | |
394 | 398 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
395 | 399 | else throw("Strict value is not equal to itself.") | |
396 | 400 | } | |
397 | 401 | else throw("Strict value is not equal to itself.") | |
398 | 402 | } | |
399 | 403 | ||
400 | 404 | ||
401 | 405 | func exchangeSwopFi (toToken,pmtAmount,pmtAsset,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
402 | 406 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
403 | 407 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
404 | 408 | then { | |
405 | 409 | let inv = invoke(exContract, "swopfiSwap", [exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
406 | 410 | if ((inv == inv)) | |
407 | 411 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
408 | 412 | else throw("Strict value is not equal to itself.") | |
409 | 413 | } | |
410 | 414 | else throw("Strict value is not equal to itself.") | |
411 | 415 | } | |
412 | 416 | ||
413 | 417 | ||
414 | 418 | func capitalize (pool,type,tokenId,tokenAmount) = { | |
415 | 419 | let poolAddr = Address(fromBase58String(pool)) | |
416 | - | let $ | |
417 | - | let AId = $ | |
418 | - | let BId = $ | |
419 | - | let balA = $ | |
420 | - | let balB = $ | |
421 | - | let shareId = $ | |
422 | - | let $ | |
420 | + | let $t01319013268 = getPoolData(poolAddr, type) | |
421 | + | let AId = $t01319013268._1 | |
422 | + | let BId = $t01319013268._2 | |
423 | + | let balA = $t01319013268._3 | |
424 | + | let balB = $t01319013268._4 | |
425 | + | let shareId = $t01319013268._5 | |
426 | + | let $t01327113351 = if ((tokenId == AId)) | |
423 | 427 | then $Tuple2(tokenAmount, 0) | |
424 | 428 | else $Tuple2(0, tokenAmount) | |
425 | - | let pmtA = $ | |
426 | - | let pmtB = $ | |
427 | - | let $ | |
429 | + | let pmtA = $t01327113351._1 | |
430 | + | let pmtB = $t01327113351._2 | |
431 | + | let $t01335413715 = if ((type == SF_POOL)) | |
428 | 432 | then replenishSwopFi(pool, CAP_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
429 | 433 | else replenishWX(pool, CAP_FEE, pmtA, AId, pmtB, BId, shareId) | |
430 | - | let stakedAmount = $ | |
431 | - | let axlyFee = $ | |
434 | + | let stakedAmount = $t01335413715._1 | |
435 | + | let axlyFee = $t01335413715._2 | |
432 | 436 | let curPoolInterest = valueOrElse(getInteger(this, (pool + kPoolInterest)), 0) | |
433 | 437 | let totalShareAmount = getPoolTotalShare(pool) | |
434 | 438 | let newInterest = (curPoolInterest + fraction(stakedAmount, SCALE10, totalShareAmount)) | |
435 | 439 | [IntegerEntry((pool + kPoolInterest), newInterest), ScriptTransfer(moneyBox, axlyFee, fromBase58String(shareId))] | |
436 | 440 | } | |
441 | + | ||
442 | + | ||
443 | + | func exchangeDirectlySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
444 | + | let poolAddr = Address(fromBase58String(pool)) | |
445 | + | let feeScale6 = 1000000 | |
446 | + | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
447 | + | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee)) | |
448 | + | let $t01440814696 = if ((assetTokenToGet == assetIdA)) | |
449 | + | then { | |
450 | + | let amountToPay = fraction(balA, amntGetNoFee, (balB - amntGetNoFee)) | |
451 | + | $Tuple2(amountToPay, assetIdB) | |
452 | + | } | |
453 | + | else { | |
454 | + | let amountToPay = fraction(balB, amntGetNoFee, (balA - amntGetNoFee)) | |
455 | + | $Tuple2(amountToPay, assetIdA) | |
456 | + | } | |
457 | + | let amountToPay = $t01440814696._1 | |
458 | + | let assetToPay = $t01440814696._2 | |
459 | + | invoke(poolAddr, "callFunction", ["exchange", "1"], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
460 | + | } | |
461 | + | ||
462 | + | ||
463 | + | func exchangeDirectlyWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
464 | + | let poolAddr = Address(fromBase58String(pool)) | |
465 | + | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
466 | + | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
467 | + | let feeScale = toBigInt(100000000) | |
468 | + | let $t01517315481 = if ((assetTokenToGet == assetIdA)) | |
469 | + | then { | |
470 | + | let amountToPay = fraction(balA, amountTokenToGet, (balB - amountTokenToGet)) | |
471 | + | $Tuple2(amountToPay, assetIdB) | |
472 | + | } | |
473 | + | else { | |
474 | + | let amountToPay = fraction(balB, amountTokenToGet, (balA - amountTokenToGet)) | |
475 | + | $Tuple2(amountToPay, assetIdA) | |
476 | + | } | |
477 | + | let amountToPay = $t01517315481._1 | |
478 | + | let assetToPay = $t01517315481._2 | |
479 | + | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))))) | |
480 | + | invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPayWithFee)]) | |
481 | + | } | |
482 | + | ||
483 | + | ||
484 | + | func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL)) | |
485 | + | then exchangeDirectlySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
486 | + | else exchangeDirectlyWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
437 | 487 | ||
438 | 488 | ||
439 | 489 | @Callable(i) | |
440 | 490 | func replenish (pool,leverage,borrowAssetId) = if (if ((100 > leverage)) | |
441 | 491 | then true | |
442 | 492 | else (leverage > 300)) | |
443 | 493 | then throw("Leverage can't be <100 and >300") | |
444 | 494 | else { | |
445 | 495 | let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
446 | - | let $ | |
447 | - | let AId = $ | |
448 | - | let BId = $ | |
449 | - | let balA = $ | |
450 | - | let balB = $ | |
451 | - | let shareId = $ | |
452 | - | let $ | |
496 | + | let $t01638216471 = getPoolData(Address(fromBase58String(pool)), type) | |
497 | + | let AId = $t01638216471._1 | |
498 | + | let BId = $t01638216471._2 | |
499 | + | let balA = $t01638216471._3 | |
500 | + | let balB = $t01638216471._4 | |
501 | + | let shareId = $t01638216471._5 | |
502 | + | let $t01647417111 = if ((size(i.payments) == 2)) | |
453 | 503 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
454 | 504 | then throw("Wrong payment asset A") | |
455 | 505 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
456 | 506 | then throw("Wrong payment asset B") | |
457 | 507 | else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId) | |
458 | 508 | else if ((size(i.payments) == 1)) | |
459 | 509 | then if ((assetIdToStr(i.payments[0].assetId) == AId)) | |
460 | 510 | then $Tuple4(i.payments[0].amount, AId, 0, BId) | |
461 | 511 | else if ((assetIdToStr(i.payments[0].assetId) == BId)) | |
462 | 512 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
463 | 513 | else throw("Wrong payment") | |
464 | 514 | else throw("One or two payments expected") | |
465 | - | let pmtA = $ | |
466 | - | let pmtAssetA = $ | |
467 | - | let pmtB = $ | |
468 | - | let pmtAssetB = $ | |
515 | + | let pmtA = $t01647417111._1 | |
516 | + | let pmtAssetA = $t01647417111._2 | |
517 | + | let pmtB = $t01647417111._3 | |
518 | + | let pmtAssetB = $t01647417111._4 | |
469 | 519 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
470 | 520 | if ((leverage > 100)) | |
471 | 521 | then { | |
472 | 522 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
473 | 523 | if ($isInstanceOf(@, "(Int, Int)")) | |
474 | 524 | then @ | |
475 | 525 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
476 | 526 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetB, false], nil) | |
477 | 527 | if ($isInstanceOf(@, "(Int, Int)")) | |
478 | 528 | then @ | |
479 | 529 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
480 | 530 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(pmtAssetA), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(pmtAssetB), 0, 0, DOWN))) | |
481 | 531 | let borrowAmount = fraction(paydInDollar, (leverage - 100), 100) | |
482 | 532 | let request = makeString([type, toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowAssetId, toString(borrowAmount), toString(newPosNum)], ",") | |
483 | 533 | let newRequestId = { | |
484 | 534 | let @ = invoke(this, "createNewRequest", [request], nil) | |
485 | 535 | if ($isInstanceOf(@, "Int")) | |
486 | 536 | then @ | |
487 | - | else | |
537 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
488 | 538 | } | |
489 | 539 | if ((newRequestId == newRequestId)) | |
490 | 540 | then { | |
491 | 541 | let args = [((toString(i.caller) + "_") + toString(newPosNum)), shareId, borrowAssetId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
492 | 542 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
493 | 543 | if ((inv == inv)) | |
494 | 544 | then nil | |
495 | 545 | else throw("Strict value is not equal to itself.") | |
496 | 546 | } | |
497 | 547 | else throw("Strict value is not equal to itself.") | |
498 | 548 | } | |
499 | 549 | else { | |
500 | - | let $ | |
550 | + | let $t01845218843 = if ((type == SF_POOL)) | |
501 | 551 | then replenishSwopFi(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, balA, balB, shareId) | |
502 | 552 | else replenishWX(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, shareId) | |
503 | - | let userStaked = $ | |
504 | - | let axlyFee = $ | |
553 | + | let userStaked = $t01845218843._1 | |
554 | + | let axlyFee = $t01845218843._2 | |
505 | 555 | replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, type) | |
506 | 556 | } | |
507 | 557 | } | |
508 | 558 | ||
509 | 559 | ||
510 | 560 | ||
511 | 561 | @Callable(i) | |
512 | 562 | func replenishFromLand (requestId) = { | |
513 | 563 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
514 | 564 | if ((size(i.payments) != 1)) | |
515 | 565 | then throw("Wrong payment size") | |
516 | 566 | else if (if ((assetIdToStr(i.payments[0].assetId) != request[10])) | |
517 | 567 | then true | |
518 | 568 | else (i.payments[0].amount != parseIntValue(request[11]))) | |
519 | 569 | then throw("Wrong payment") | |
520 | 570 | else { | |
521 | 571 | let pmtA = if ((request[4] == assetIdToStr(i.payments[0].assetId))) | |
522 | 572 | then (parseIntValue(request[3]) + i.payments[0].amount) | |
523 | 573 | else parseIntValue(request[3]) | |
524 | 574 | let pmtB = if ((request[6] == assetIdToStr(i.payments[0].assetId))) | |
525 | 575 | then (parseIntValue(request[5]) + i.payments[0].amount) | |
526 | 576 | else parseIntValue(request[3]) | |
527 | 577 | let pool = request[2] | |
528 | 578 | let user = request[1] | |
529 | 579 | let shareId = request[9] | |
530 | 580 | let posNum = parseIntValue(request[12]) | |
531 | - | let $ | |
581 | + | let $t01980120316 = if ((request[0] == SF_POOL)) | |
532 | 582 | then replenishSwopFi(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], parseIntValue(request[7]), parseIntValue(request[8]), shareId) | |
533 | - | else if ((request[0] == WX_ | |
583 | + | else if ((request[0] == WX_POOL)) | |
534 | 584 | then replenishWX(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], shareId) | |
535 | 585 | else throw("Wrong request type") | |
536 | - | let userStaked = $ | |
537 | - | let axlyFee = $ | |
586 | + | let userStaked = $t01980120316._1 | |
587 | + | let axlyFee = $t01980120316._2 | |
538 | 588 | let borrowEntries = [IntegerEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAmount), i.payments[0].amount), StringEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAssetId), request[10])] | |
539 | 589 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, request[0]) | |
540 | 590 | $Tuple2(((entries ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
541 | 591 | } | |
542 | 592 | } | |
543 | 593 | ||
544 | 594 | ||
545 | 595 | ||
546 | 596 | @Callable(i) | |
547 | 597 | func withdraw (pool,posId) = { | |
548 | 598 | let user = toString(i.caller) | |
549 | - | let pType = valueOrErrorMessage(getString(this, ( | |
550 | - | let pAmount = | |
599 | + | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
600 | + | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), "Unknown position") | |
551 | 601 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)) | |
552 | 602 | let poolInterst = getIntegerValue(this, (pool + kPoolInterest)) | |
553 | - | let poolTotalShare = | |
603 | + | let poolTotalShare = getPoolTotalShare(pool) | |
554 | 604 | let userCanWithdraw = (pAmount + fraction(pAmount, (poolInterst - userInterest), SCALE10)) | |
555 | 605 | let poolAddr = Address(fromBase58String(pool)) | |
556 | 606 | let userAddr = Address(fromBase58String(user)) | |
557 | 607 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAmount)) | |
558 | 608 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAssetId)) | |
559 | - | let $ | |
560 | - | let assetIdA = $ | |
561 | - | let assetIdB = $ | |
562 | - | let balA = $ | |
563 | - | let balB = $ | |
564 | - | let shareId = $ | |
609 | + | let $t02166221762 = getPoolData(Address(fromBase58String(pool)), pType) | |
610 | + | let assetIdA = $t02166221762._1 | |
611 | + | let assetIdB = $t02166221762._2 | |
612 | + | let balA = $t02166221762._3 | |
613 | + | let balB = $t02166221762._4 | |
614 | + | let shareId = $t02166221762._5 | |
565 | 615 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
566 | 616 | if ((cBalABefore == cBalABefore)) | |
567 | 617 | then { | |
568 | 618 | let cBalBBefore = accountBalance(assetIdFromStr(assetIdB)) | |
569 | 619 | if ((cBalBBefore == cBalBBefore)) | |
570 | 620 | then { | |
571 | - | let inv = if ((pType == SF_ | |
621 | + | let inv = if ((pType == SF_POOL)) | |
572 | 622 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
573 | - | else if ((pType == WX_ | |
623 | + | else if ((pType == WX_POOL)) | |
574 | 624 | then invoke(poolAddr, "unstakeAndGet", [userCanWithdraw], nil) | |
575 | 625 | else throw("Wrong position type") | |
576 | 626 | if ((inv == inv)) | |
577 | 627 | then { | |
578 | 628 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
579 | 629 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
580 | - | let $t02033320422 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
581 | - | let tokensAmountA = $t02033320422._1 | |
582 | - | let tokensAmountB = $t02033320422._2 | |
583 | - | [DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionType)), DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, tokensAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, tokensAmountB, assetIdFromStr(assetIdB))] | |
630 | + | let $t02227422363 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
631 | + | let tokensAmountA = $t02227422363._1 | |
632 | + | let tokensAmountB = $t02227422363._2 | |
633 | + | let $t02236623358 = if ((borrowAmount > 0)) | |
634 | + | then { | |
635 | + | let debt = { | |
636 | + | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((((pool + "_") + user) + "_") + toString(posId)), borrowAsset], nil) | |
637 | + | if ($isInstanceOf(@, "Int")) | |
638 | + | then @ | |
639 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
640 | + | } | |
641 | + | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
642 | + | then (debt > tokensAmountA) | |
643 | + | else false) | |
644 | + | then (debt - tokensAmountA) | |
645 | + | else if (if ((borrowAsset == assetIdB)) | |
646 | + | then (debt > tokensAmountB) | |
647 | + | else false) | |
648 | + | then (debt - tokensAmountB) | |
649 | + | else 0 | |
650 | + | let exInv = if ((amountToGetEx > 0)) | |
651 | + | then exchangeDirectly(pType, pool, assetIdA, assetIdB, balA, balB, amountToGetEx, borrowAsset) | |
652 | + | else 0 | |
653 | + | if ((exInv == exInv)) | |
654 | + | then { | |
655 | + | let closeDbtInv = invoke(getLendSrvAddr(), "repay", [((user + "_") + toString(posId))], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
656 | + | if ((closeDbtInv == closeDbtInv)) | |
657 | + | then { | |
658 | + | let cBalAAfterRepay = accountBalance(assetIdFromStr(assetIdA)) | |
659 | + | let cBalBAfterRepay = accountBalance(assetIdFromStr(assetIdB)) | |
660 | + | $Tuple2((cBalAAfterRepay - cBalABefore), (cBalBAfterRepay - cBalBBefore)) | |
661 | + | } | |
662 | + | else throw("Strict value is not equal to itself.") | |
663 | + | } | |
664 | + | else throw("Strict value is not equal to itself.") | |
665 | + | } | |
666 | + | else $Tuple2(tokensAmountA, tokensAmountB) | |
667 | + | let toUserAmountA = $t02236623358._1 | |
668 | + | let toUserAmountB = $t02236623358._2 | |
669 | + | [DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, tokensAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, tokensAmountB, assetIdFromStr(assetIdB))] | |
584 | 670 | } | |
585 | 671 | else throw("Strict value is not equal to itself.") | |
586 | 672 | } | |
587 | 673 | else throw("Strict value is not equal to itself.") | |
588 | 674 | } | |
589 | 675 | else throw("Strict value is not equal to itself.") | |
590 | 676 | } | |
591 | 677 | ||
592 | 678 | ||
593 | 679 | ||
594 | 680 | @Callable(i) | |
595 | 681 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
596 | 682 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
597 | 683 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId) | |
598 | 684 | }) | |
599 | 685 | ||
600 | 686 | ||
601 | 687 | ||
602 | 688 | @Callable(i) | |
603 | 689 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
604 | - | let $ | |
690 | + | let $t02446724661 = if (claim) | |
605 | 691 | then claimFarmed(type, pool) | |
606 | 692 | else { | |
607 | - | let claimedAsset = if ((type == SF_ | |
693 | + | let claimedAsset = if ((type == SF_POOL)) | |
608 | 694 | then SWOPID | |
609 | 695 | else WXID | |
610 | 696 | $Tuple2(amountToExchange, claimedAsset) | |
611 | 697 | } | |
612 | - | let claimedAmount = $ | |
613 | - | let claimedAsset = $ | |
698 | + | let claimedAmount = $t02446724661._1 | |
699 | + | let claimedAsset = $t02446724661._2 | |
614 | 700 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
615 | 701 | let change = (claimedAmount - amountToExchange) | |
616 | 702 | let changeEntry = if ((change > 0)) | |
617 | 703 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
618 | 704 | else nil | |
619 | 705 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
620 | 706 | } | |
621 | 707 | ||
622 | 708 | ||
623 | 709 | ||
624 | 710 | @Callable(i) | |
625 | 711 | func capitalizeExPazzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
626 | - | let $ | |
712 | + | let $t02531725511 = if (claim) | |
627 | 713 | then claimFarmed(type, pool) | |
628 | 714 | else { | |
629 | - | let claimedAsset = if ((type == SF_ | |
715 | + | let claimedAsset = if ((type == SF_POOL)) | |
630 | 716 | then SWOPID | |
631 | 717 | else WXID | |
632 | 718 | $Tuple2(amountToExchange, claimedAsset) | |
633 | 719 | } | |
634 | - | let claimedAmount = $ | |
635 | - | let claimedAsset = $ | |
720 | + | let claimedAmount = $t02531725511._1 | |
721 | + | let claimedAsset = $t02531725511._2 | |
636 | 722 | let exchangedAmount = exchangePazzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
637 | 723 | let change = (claimedAmount - amountToExchange) | |
638 | 724 | let changeEntry = if ((change > 0)) | |
639 | 725 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
640 | 726 | else nil | |
641 | 727 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
642 | 728 | } | |
643 | 729 | ||
644 | 730 | ||
645 | 731 | ||
646 | 732 | @Callable(i) | |
647 | 733 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
648 | - | let $ | |
734 | + | let $t02623426428 = if (claim) | |
649 | 735 | then claimFarmed(type, pool) | |
650 | 736 | else { | |
651 | - | let claimedAsset = if ((type == SF_ | |
737 | + | let claimedAsset = if ((type == SF_POOL)) | |
652 | 738 | then SWOPID | |
653 | 739 | else WXID | |
654 | 740 | $Tuple2(amountToExchange, claimedAsset) | |
655 | 741 | } | |
656 | - | let claimedAmount = $ | |
657 | - | let claimedAsset = $ | |
742 | + | let claimedAmount = $t02623426428._1 | |
743 | + | let claimedAsset = $t02623426428._2 | |
658 | 744 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
659 | 745 | let change = (claimedAmount - amountToExchange) | |
660 | 746 | let changeEntry = if ((change > 0)) | |
661 | 747 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
662 | 748 | else nil | |
663 | 749 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
664 | 750 | } | |
665 | 751 | ||
666 | 752 | ||
667 | 753 | ||
668 | 754 | @Callable(i) | |
669 | - | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFee) = if (if ((type != SF_ | |
670 | - | then (type != WX_ | |
755 | + | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFee) = if (if ((type != SF_POOL)) | |
756 | + | then (type != WX_POOL) | |
671 | 757 | else false) | |
672 | 758 | then throw("Wrong type") | |
673 | 759 | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), IntegerEntry((poolAddr + kPoolInterest), 0), StringEntry((kPool + poolAddr), type)] | |
674 | 760 | ||
675 | 761 | ||
676 | 762 | @Verifier(tx) | |
677 | 763 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
678 | 764 |
github/deemru/w8io/026f985 97.33 ms ◑