tx · G3JAdpq4Jv68ad3r8K5MfoR6xRzXRKU5AKfKPiTPMLfk 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.32000000 Waves 2023.04.20 10:50 [2542593] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "G3JAdpq4Jv68ad3r8K5MfoR6xRzXRKU5AKfKPiTPMLfk", "fee": 32000000, "feeAssetId": null, "timestamp": 1681977024482, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "5xnpxV4XmnmKRGzMjBuMF8SeR6ne339z1nrxJDWDD1z4gD9GQHMcSyDNv5YE8FvVR3KmMsVW1SFrnkEmvpRzqGMF" ], "script": "base64:BgJlCAISAwoBCBIDCgEIEgUKAwgBCBIDCgEIEgUKAwgBCBIDCgEIEgQKAggBEgMKAQgSDgoMCAgIAQQRGBgRAQEYEgoKCAgICAEECAEYEg4KDAgICAEEGBgYGBgBGBIICgYICAEBAQFJAAdTRl9QT09MAgJTRgAHV1hfUE9PTAICV1gAD0NBUF9GRUVfTk9fTE9BTgIJY2FwTm9Mb2FuAAxDQVBfRkVFX0xPQU4CB2NhcExvYW4ACExPQU5fRkVFAgRsb2FuAAtOT19MT0FOX0ZFRQIGbm9Mb2FuAAZTQ0FMRTgAgMLXLwAHU0NBTEUxMACAyK+gJQAKRkVFX1NDQUxFNgDAhD0AFGtTRlBvb2xBQXNzZXRCYWxhbmNlAg9BX2Fzc2V0X2JhbGFuY2UAFGtTRlBvb2xCQXNzZXRCYWxhbmNlAg9CX2Fzc2V0X2JhbGFuY2UAD2tTRlBvb2xBQXNzZXRJZAIKQV9hc3NldF9pZAAPa1NGUG9vbEJBc3NldElkAgpCX2Fzc2V0X2lkAA5rU0ZQb29sU2hhcmVJZAIOc2hhcmVfYX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UG9vbEludGVyZXN0AAAJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQVrUG9vbAUIcG9vbEFkZHIFBHR5cGUJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQdzaGFyZUlkBQprU2hhcmVQb29sBQhwb29sQWRkcgUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleecYp4I=", "height": 2542593, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3hoWt5UxKr2tE3ZN9Rdp28thqzX28PitvoW7kvgnDkXN Next: D5fR9GKAFo54kJi9S7gKH27SmohD7tgNEpmujjBqCHFk Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let WX_POOL = "WX" | |
7 | 7 | ||
8 | - | let CAP_FEE = "cap" | |
8 | + | let CAP_FEE_NO_LOAN = "capNoLoan" | |
9 | + | ||
10 | + | let CAP_FEE_LOAN = "capLoan" | |
9 | 11 | ||
10 | 12 | let LOAN_FEE = "loan" | |
11 | 13 | ||
41 | 43 | ||
42 | 44 | let kPoolTotal = "_pool_total" | |
43 | 45 | ||
46 | + | let kPoolTotalLoan = "_pool_total_loan" | |
47 | + | ||
44 | 48 | let kPoolInterest = "_pool_interest" | |
45 | 49 | ||
46 | 50 | let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan" | |
47 | 51 | ||
48 | 52 | let kAxlyInFeeWithLoan = "_axly_fee_with_loan" | |
49 | 53 | ||
50 | - | let kAxlyCapFee = "_axly_fee_cap" | |
54 | + | let kAxlyNoLoanCapFee = "_axly_fee_cap_with_loan" | |
55 | + | ||
56 | + | let kAxlyWithLoanCapFee = "_axly_fee_cap_no_loan" | |
51 | 57 | ||
52 | 58 | let kRequestId = "_request_id" | |
53 | 59 | ||
54 | 60 | let kRequestIter = "requests_iter" | |
55 | 61 | ||
56 | 62 | let kPool = "pool_" | |
63 | + | ||
64 | + | let kSharePool = "_pool_share_id" | |
57 | 65 | ||
58 | 66 | let kPoolCapChange = "_pool_cap_change" | |
59 | 67 | ||
107 | 115 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
108 | 116 | } | |
109 | 117 | if ((cfg == cfg)) | |
110 | - | then $Tuple5(valueOrErrorMessage({ | |
111 | - | let @ = cfg[4] | |
112 | - | if ($isInstanceOf(@, "String")) | |
113 | - | then @ | |
114 | - | else unit | |
115 | - | }, "Can't get pool A asset id"), valueOrErrorMessage({ | |
116 | - | let @ = cfg[5] | |
117 | - | if ($isInstanceOf(@, "String")) | |
118 | - | then @ | |
119 | - | else unit | |
120 | - | }, "Can't get pool B asset id"), 0, 0, valueOrErrorMessage({ | |
121 | - | let @ = cfg[3] | |
122 | - | if ($isInstanceOf(@, "String")) | |
123 | - | then @ | |
124 | - | else unit | |
125 | - | }, "Can't get pool LP asset id")) | |
118 | + | then { | |
119 | + | let aId = valueOrErrorMessage({ | |
120 | + | let @ = cfg[4] | |
121 | + | if ($isInstanceOf(@, "String")) | |
122 | + | then @ | |
123 | + | else unit | |
124 | + | }, "Can't get pool A asset id") | |
125 | + | let bId = valueOrErrorMessage({ | |
126 | + | let @ = cfg[5] | |
127 | + | if ($isInstanceOf(@, "String")) | |
128 | + | then @ | |
129 | + | else unit | |
130 | + | }, "Can't get pool B asset id") | |
131 | + | let shareId = valueOrErrorMessage({ | |
132 | + | let @ = cfg[3] | |
133 | + | if ($isInstanceOf(@, "String")) | |
134 | + | then @ | |
135 | + | else unit | |
136 | + | }, "Can't get pool LP asset id") | |
137 | + | let balA = { | |
138 | + | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [aId], nil) | |
139 | + | if ($isInstanceOf(@, "Int")) | |
140 | + | then @ | |
141 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
142 | + | } | |
143 | + | if ((balA == balA)) | |
144 | + | then { | |
145 | + | let balB = { | |
146 | + | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [bId], nil) | |
147 | + | if ($isInstanceOf(@, "Int")) | |
148 | + | then @ | |
149 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
150 | + | } | |
151 | + | if ((balB == balB)) | |
152 | + | then $Tuple5(aId, bId, balA, balB, shareId) | |
153 | + | else throw("Strict value is not equal to itself.") | |
154 | + | } | |
155 | + | else throw("Strict value is not equal to itself.") | |
156 | + | } | |
126 | 157 | else throw("Strict value is not equal to itself.") | |
127 | 158 | } | |
128 | 159 | ||
137 | 168 | func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0) | |
138 | 169 | ||
139 | 170 | ||
171 | + | func getPoolTotalShareWithLoan (pool) = valueOrElse(getInteger(this, (pool + kPoolTotalLoan)), 0) | |
172 | + | ||
173 | + | ||
140 | 174 | func getNewUserPositionNumber (pool,user) = (valueOrElse(getInteger(this, (((pool + "_") + user) + kUserPositionNum)), 0) + 1) | |
141 | 175 | ||
142 | 176 | ||
143 | - | func getAxlyFee (pool,feeType) = if ((feeType == "cap")) | |
144 | - | then getIntegerValue(this, (pool + kAxlyCapFee)) | |
145 | - | else if ((feeType == "loan")) | |
146 | - | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
147 | - | else if ((feeType == "noLoan")) | |
148 | - | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
149 | - | else throw("Wrong fee type") | |
177 | + | func getAxlyFee (pool,feeType) = if ((feeType == CAP_FEE_LOAN)) | |
178 | + | then getIntegerValue(this, (pool + kAxlyWithLoanCapFee)) | |
179 | + | else if ((feeType == CAP_FEE_NO_LOAN)) | |
180 | + | then getIntegerValue(this, (pool + kAxlyNoLoanCapFee)) | |
181 | + | else if ((feeType == LOAN_FEE)) | |
182 | + | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
183 | + | else if ((feeType == NO_LOAN_FEE)) | |
184 | + | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
185 | + | else throw("Wrong fee type") | |
150 | 186 | ||
151 | 187 | ||
152 | 188 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
194 | 230 | let poolAddr = Address(fromBase58String(pool)) | |
195 | 231 | let ratioA = fraction(SCALE8, pmtA, balA) | |
196 | 232 | let ratioB = fraction(SCALE8, pmtB, balB) | |
197 | - | let $ | |
233 | + | let $t071357427 = if ((ratioB > ratioA)) | |
198 | 234 | then { | |
199 | 235 | let pmt = fraction(balB, ratioA, SCALE8, CEILING) | |
200 | 236 | $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB) | |
203 | 239 | let pmt = fraction(balA, ratioB, SCALE8, CEILING) | |
204 | 240 | $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA) | |
205 | 241 | } | |
206 | - | let pmtAmountA = $ | |
207 | - | let pmtAmountB = $ | |
208 | - | let change = $ | |
209 | - | let changeAssetId = $ | |
242 | + | let pmtAmountA = $t071357427._1 | |
243 | + | let pmtAmountB = $t071357427._2 | |
244 | + | let change = $t071357427._3 | |
245 | + | let changeAssetId = $t071357427._4 | |
210 | 246 | let inv1 = if (if ((pmtAmountA > 0)) | |
211 | 247 | then (pmtAmountB > 0) | |
212 | 248 | else false) | |
249 | 285 | ||
250 | 286 | func replenishWX (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,shareId) = { | |
251 | 287 | let poolAddr = Address(fromBase58String(pool)) | |
252 | - | let $ | |
288 | + | let $t088789727 = if (if ((pmtA > 0)) | |
253 | 289 | then (pmtB > 0) | |
254 | 290 | else false) | |
255 | 291 | then { | |
290 | 326 | else if ((pmtB > 0)) | |
291 | 327 | then $Tuple4(pmtA, pmtB, pmtB, pmtAssetB) | |
292 | 328 | else throw("pmts must be > 0") | |
293 | - | let pmtAmountA = $ | |
294 | - | let pmtAmountB = $ | |
295 | - | let change = $ | |
296 | - | let changeAssetId = $ | |
329 | + | let pmtAmountA = $t088789727._1 | |
330 | + | let pmtAmountB = $t088789727._2 | |
331 | + | let change = $t088789727._3 | |
332 | + | let changeAssetId = $t088789727._4 | |
297 | 333 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
298 | 334 | if ((shareBalanceBefore == shareBalanceBefore)) | |
299 | 335 | then { | |
345 | 381 | ||
346 | 382 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type) = { | |
347 | 383 | let totalAmount = getPoolTotalShare(pool) | |
384 | + | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
348 | 385 | let curPoolInterest = getIntegerValue(this, (pool + kPoolInterest)) | |
349 | - | [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))] | |
386 | + | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), (totalAmountLoan + 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))] | |
350 | 387 | } | |
351 | 388 | ||
352 | 389 | ||
424 | 461 | ||
425 | 462 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
426 | 463 | let poolAddr = Address(fromBase58String(pool)) | |
427 | - | let $ | |
428 | - | let AId = $ | |
429 | - | let BId = $ | |
430 | - | let balA = $ | |
431 | - | let balB = $ | |
432 | - | let shareId = $ | |
433 | - | let $ | |
464 | + | let $t01469114770 = getPoolData(poolAddr, pType) | |
465 | + | let AId = $t01469114770._1 | |
466 | + | let BId = $t01469114770._2 | |
467 | + | let balA = $t01469114770._3 | |
468 | + | let balB = $t01469114770._4 | |
469 | + | let shareId = $t01469114770._5 | |
470 | + | let $t01477314853 = if ((tokenId == AId)) | |
434 | 471 | then $Tuple2(tokenAmount, 0) | |
435 | 472 | else $Tuple2(0, tokenAmount) | |
436 | - | let pmtA = $ | |
437 | - | let pmtB = $ | |
438 | - | let $ | |
439 | - | let stakedAmount = $ | |
440 | - | let axlyFee = $ | |
473 | + | let pmtA = $t01477314853._1 | |
474 | + | let pmtB = $t01477314853._2 | |
475 | + | let $t01485614971 = replenishByType(pType, pool, CAP_FEE_LOAN, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
476 | + | let stakedAmount = $t01485614971._1 | |
477 | + | let axlyFee = $t01485614971._2 | |
441 | 478 | let curPoolInterest = valueOrElse(getInteger(this, (pool + kPoolInterest)), 0) | |
442 | 479 | let totalShareAmount = getPoolTotalShare(pool) | |
443 | 480 | let newInterest = (curPoolInterest + fraction(stakedAmount, SCALE10, totalShareAmount)) | |
450 | 487 | let feeScale6 = 1000000 | |
451 | 488 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
452 | 489 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee)) | |
453 | - | let $ | |
490 | + | let $t01566415952 = if ((assetTokenToGet == assetIdA)) | |
454 | 491 | then { | |
455 | 492 | let amountToPay = fraction(balA, amntGetNoFee, (balB - amntGetNoFee)) | |
456 | 493 | $Tuple2(amountToPay, assetIdB) | |
459 | 496 | let amountToPay = fraction(balB, amntGetNoFee, (balA - amntGetNoFee)) | |
460 | 497 | $Tuple2(amountToPay, assetIdA) | |
461 | 498 | } | |
462 | - | let amountToPay = $ | |
463 | - | let assetToPay = $ | |
499 | + | let amountToPay = $t01566415952._1 | |
500 | + | let assetToPay = $t01566415952._2 | |
464 | 501 | invoke(poolAddr, "callFunction", ["exchange", ["1"]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
465 | 502 | } | |
466 | 503 | ||
470 | 507 | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
471 | 508 | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
472 | 509 | let feeScale = toBigInt(100000000) | |
473 | - | let $ | |
510 | + | let $t01643116739 = if ((assetTokenToGet == assetIdA)) | |
474 | 511 | then { | |
475 | 512 | let amountToPay = fraction(balA, amountTokenToGet, (balB - amountTokenToGet)) | |
476 | 513 | $Tuple2(amountToPay, assetIdB) | |
479 | 516 | let amountToPay = fraction(balB, amountTokenToGet, (balA - amountTokenToGet)) | |
480 | 517 | $Tuple2(amountToPay, assetIdA) | |
481 | 518 | } | |
482 | - | let amountToPay = $ | |
483 | - | let assetToPay = $ | |
519 | + | let amountToPay = $t01643116739._1 | |
520 | + | let assetToPay = $t01643116739._2 | |
484 | 521 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))))) | |
485 | 522 | invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPayWithFee)]) | |
486 | 523 | } | |
494 | 531 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = { | |
495 | 532 | let poolAddr = Address(fromBase58String(pool)) | |
496 | 533 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
497 | - | let $ | |
498 | - | let assetIdA = $ | |
499 | - | let assetIdB = $ | |
500 | - | let balA = $ | |
501 | - | let balB = $ | |
534 | + | let $t01760417671 = getPoolData(poolAddr, pType) | |
535 | + | let assetIdA = $t01760417671._1 | |
536 | + | let assetIdB = $t01760417671._2 | |
537 | + | let balA = $t01760417671._3 | |
538 | + | let balB = $t01760417671._4 | |
502 | 539 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
503 | 540 | if ((cBalABefore == cBalABefore)) | |
504 | 541 | then { | |
514 | 551 | then { | |
515 | 552 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
516 | 553 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
517 | - | let $ | |
518 | - | let tokensAmountA = $ | |
519 | - | let tokensAmountB = $ | |
520 | - | let $ | |
554 | + | let $t01818318272 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
555 | + | let tokensAmountA = $t01818318272._1 | |
556 | + | let tokensAmountB = $t01818318272._2 | |
557 | + | let $t01827518971 = if ((debt > 0)) | |
521 | 558 | then { | |
522 | 559 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
523 | 560 | then (debt > tokensAmountA) | |
540 | 577 | else throw("Strict value is not equal to itself.") | |
541 | 578 | } | |
542 | 579 | else $Tuple2(tokensAmountA, tokensAmountB) | |
543 | - | let toUserAmountA = $ | |
544 | - | let toUserAmountB = $ | |
545 | - | $ | |
580 | + | let toUserAmountA = $t01827518971._1 | |
581 | + | let toUserAmountB = $t01827518971._2 | |
582 | + | $Tuple6(toUserAmountA, assetIdA, toUserAmountB, assetIdB, cBalAAfter, cBalBAfter) | |
546 | 583 | } | |
547 | 584 | else throw("Strict value is not equal to itself.") | |
548 | 585 | } | |
570 | 607 | ||
571 | 608 | ||
572 | 609 | @Callable(i) | |
610 | + | func getAssetPrice (assetId) = $Tuple2(nil, (let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil) | |
611 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
612 | + | then @ | |
613 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2) | |
614 | + | ||
615 | + | ||
616 | + | ||
617 | + | @Callable(i) | |
618 | + | func getSharePrice (shareId) = { | |
619 | + | let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id") | |
620 | + | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
621 | + | let $t02006620136 = getPoolData(Address(fromBase58String(pool)), pType) | |
622 | + | let aId = $t02006620136._1 | |
623 | + | let bId = $t02006620136._2 | |
624 | + | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [aId, false], nil) | |
625 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
626 | + | then @ | |
627 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
628 | + | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [bId, false], nil) | |
629 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
630 | + | then @ | |
631 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
632 | + | $Tuple2(nil, (dPriceA + dPriceB)) | |
633 | + | } | |
634 | + | ||
635 | + | ||
636 | + | ||
637 | + | @Callable(i) | |
573 | 638 | func replenishEVALONLY (pool,leverage,borrowAssetId) = if (if ((100 > leverage)) | |
574 | 639 | then true | |
575 | 640 | else (leverage > 300)) | |
576 | 641 | then throw("Leverage can't be <100 and >300") | |
577 | 642 | else { | |
578 | 643 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
579 | - | let $ | |
580 | - | let AId = $ | |
581 | - | let BId = $ | |
582 | - | let balA = $ | |
583 | - | let balB = $ | |
584 | - | let shareId = $ | |
585 | - | let $ | |
644 | + | let $t02062120711 = getPoolData(Address(fromBase58String(pool)), pType) | |
645 | + | let AId = $t02062120711._1 | |
646 | + | let BId = $t02062120711._2 | |
647 | + | let balA = $t02062120711._3 | |
648 | + | let balB = $t02062120711._4 | |
649 | + | let shareId = $t02062120711._5 | |
650 | + | let $t02071421351 = if ((size(i.payments) == 2)) | |
586 | 651 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
587 | 652 | then throw("Wrong payment asset A") | |
588 | 653 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
595 | 660 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
596 | 661 | else throw("Wrong payment") | |
597 | 662 | else throw("One or two payments expected") | |
598 | - | let pmtA = $ | |
599 | - | let pmtAssetA = $ | |
600 | - | let pmtB = $ | |
601 | - | let pmtAssetB = $ | |
602 | - | let $ | |
663 | + | let pmtA = $t02071421351._1 | |
664 | + | let pmtAssetA = $t02071421351._2 | |
665 | + | let pmtB = $t02071421351._3 | |
666 | + | let pmtAssetB = $t02071421351._4 | |
667 | + | let $t02135422805 = if ((leverage > 100)) | |
603 | 668 | then { | |
604 | 669 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
605 | 670 | if ($isInstanceOf(@, "(Int, Int)")) | |
606 | 671 | then @ | |
607 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._ | |
672 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
608 | 673 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetB, false], nil) | |
609 | 674 | if ($isInstanceOf(@, "(Int, Int)")) | |
610 | 675 | then @ | |
611 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._ | |
676 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
612 | 677 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(pmtAssetA), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(pmtAssetB), 0, 0, DOWN))) | |
613 | 678 | let borrowAmount = fraction(paydInDollar, (leverage - 100), 100) | |
614 | 679 | let request = makeString([toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowAssetId, toString(borrowAmount), toString(1)], ",") | |
629 | 694 | else throw("Strict value is not equal to itself.") | |
630 | 695 | } | |
631 | 696 | else $Tuple2(replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)._1, 0) | |
632 | - | let userStaked = $ | |
633 | - | let borrowAmount = $ | |
634 | - | let $ | |
635 | - | if (($ | |
697 | + | let userStaked = $t02135422805._1 | |
698 | + | let borrowAmount = $t02135422805._2 | |
699 | + | let $t02280922976 = withdrawAmountCalc(pool, userStaked, borrowAmount, borrowAssetId) | |
700 | + | if (($t02280922976 == $t02280922976)) | |
636 | 701 | then { | |
637 | - | let assetIdB = $t02124121366._4 | |
638 | - | let toUserAmountB = $t02124121366._3 | |
639 | - | let assetIdA = $t02124121366._2 | |
640 | - | let toUserAmountA = $t02124121366._1 | |
641 | - | $Tuple2(nil, [userStaked, toUserAmountA, toUserAmountB]) | |
702 | + | let userGetBBeforeRepay = $t02280922976._6 | |
703 | + | let userGetABeforeRepay = $t02280922976._5 | |
704 | + | let assetIdB = $t02280922976._4 | |
705 | + | let toUserAmountB = $t02280922976._3 | |
706 | + | let assetIdA = $t02280922976._2 | |
707 | + | let toUserAmountA = $t02280922976._1 | |
708 | + | let $t02297923094 = getPoolData(Address(fromBase58String(pool)), pType) | |
709 | + | let AIdAfter = $t02297923094._1 | |
710 | + | let BIdAfter = $t02297923094._2 | |
711 | + | let balAAfter = $t02297923094._3 | |
712 | + | let balBAfter = $t02297923094._4 | |
713 | + | let shareIdAfter = $t02297923094._5 | |
714 | + | let ratioBefore = fraction(balB, SCALE8, balA) | |
715 | + | let ratioAfter = fraction(balBAfter, SCALE8, balAAfter) | |
716 | + | let impact = (SCALE8 - fraction(ratioBefore, SCALE8, ratioAfter)) | |
717 | + | let imcatMod = if ((0 > impact)) | |
718 | + | then (impact * -1) | |
719 | + | else impact | |
720 | + | $Tuple2(nil, [userGetABeforeRepay, userGetBBeforeRepay, imcatMod]) | |
642 | 721 | } | |
643 | 722 | else throw("Strict value is not equal to itself.") | |
644 | 723 | } | |
647 | 726 | ||
648 | 727 | @Callable(i) | |
649 | 728 | func replenishFromLandEVALONLY (requestId) = { | |
650 | - | let $ | |
651 | - | let user = $ | |
652 | - | let pool = $ | |
653 | - | let pmtA = $ | |
654 | - | let AId = $ | |
655 | - | let pmtB = $ | |
656 | - | let BId = $ | |
657 | - | let balA = $ | |
658 | - | let balB = $ | |
659 | - | let shareId = $ | |
660 | - | let bwAsset = $ | |
661 | - | let bwAmount = $ | |
729 | + | let $t02346423568 = parseRequest(requestId) | |
730 | + | let user = $t02346423568._1 | |
731 | + | let pool = $t02346423568._2 | |
732 | + | let pmtA = $t02346423568._3 | |
733 | + | let AId = $t02346423568._4 | |
734 | + | let pmtB = $t02346423568._5 | |
735 | + | let BId = $t02346423568._6 | |
736 | + | let balA = $t02346423568._7 | |
737 | + | let balB = $t02346423568._8 | |
738 | + | let shareId = $t02346423568._9 | |
739 | + | let bwAsset = $t02346423568._10 | |
740 | + | let bwAmount = $t02346423568._11 | |
662 | 741 | if ((size(i.payments) != 1)) | |
663 | 742 | then throw("Wrong payment size") | |
664 | 743 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
666 | 745 | else (i.payments[0].amount != bwAmount)) | |
667 | 746 | then throw("Wrong payment") | |
668 | 747 | else { | |
669 | - | let $ | |
748 | + | let $t02375823882 = if ((AId == bwAsset)) | |
670 | 749 | then $Tuple2((pmtA + i.payments[0].amount), pmtB) | |
671 | 750 | else $Tuple2(pmtA, (pmtB + i.payments[0].amount)) | |
672 | - | let pmtAllA = $ | |
673 | - | let pmtAllB = $ | |
751 | + | let pmtAllA = $t02375823882._1 | |
752 | + | let pmtAllB = $t02375823882._2 | |
674 | 753 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
675 | - | let $ | |
676 | - | let userStaked = $ | |
677 | - | let axlyFee = $ | |
754 | + | let $t02396424073 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
755 | + | let userStaked = $t02396424073._1 | |
756 | + | let axlyFee = $t02396424073._2 | |
678 | 757 | $Tuple2([IntegerEntry("EVALONLY_STAKEDAMOUNT", userStaked)], userStaked) | |
679 | 758 | } | |
680 | 759 | } | |
688 | 767 | then throw("Leverage can't be <100 and >300") | |
689 | 768 | else { | |
690 | 769 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
691 | - | let $ | |
692 | - | let AId = $ | |
693 | - | let BId = $ | |
694 | - | let balA = $ | |
695 | - | let balB = $ | |
696 | - | let shareId = $ | |
697 | - | let $ | |
770 | + | let $t02445024540 = getPoolData(Address(fromBase58String(pool)), pType) | |
771 | + | let AId = $t02445024540._1 | |
772 | + | let BId = $t02445024540._2 | |
773 | + | let balA = $t02445024540._3 | |
774 | + | let balB = $t02445024540._4 | |
775 | + | let shareId = $t02445024540._5 | |
776 | + | let $t02454325180 = if ((size(i.payments) == 2)) | |
698 | 777 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
699 | 778 | then throw("Wrong payment asset A") | |
700 | 779 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
707 | 786 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
708 | 787 | else throw("Wrong payment") | |
709 | 788 | else throw("One or two payments expected") | |
710 | - | let pmtA = $ | |
711 | - | let pmtAssetA = $ | |
712 | - | let pmtB = $ | |
713 | - | let pmtAssetB = $ | |
789 | + | let pmtA = $t02454325180._1 | |
790 | + | let pmtAssetA = $t02454325180._2 | |
791 | + | let pmtB = $t02454325180._3 | |
792 | + | let pmtAssetB = $t02454325180._4 | |
714 | 793 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
715 | 794 | if ((leverage > 100)) | |
716 | 795 | then { | |
717 | 796 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
718 | 797 | if ($isInstanceOf(@, "(Int, Int)")) | |
719 | 798 | then @ | |
720 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._ | |
799 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
721 | 800 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetB, false], nil) | |
722 | 801 | if ($isInstanceOf(@, "(Int, Int)")) | |
723 | 802 | then @ | |
724 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._ | |
803 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
725 | 804 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(pmtAssetA), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(pmtAssetB), 0, 0, DOWN))) | |
726 | 805 | let borrowAmount = fraction(paydInDollar, (leverage - 100), 100) | |
727 | 806 | let request = makeString([toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowAssetId, toString(borrowAmount)], ",") | |
742 | 821 | else throw("Strict value is not equal to itself.") | |
743 | 822 | } | |
744 | 823 | else { | |
745 | - | let $ | |
746 | - | let userStaked = $ | |
747 | - | let axlyFee = $ | |
824 | + | let $t02647726589 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
825 | + | let userStaked = $t02647726589._1 | |
826 | + | let axlyFee = $t02647726589._2 | |
748 | 827 | replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, pType) | |
749 | 828 | } | |
750 | 829 | } | |
753 | 832 | ||
754 | 833 | @Callable(i) | |
755 | 834 | func replenishFromLand (requestId) = { | |
756 | - | let $ | |
757 | - | let user = $ | |
758 | - | let pool = $ | |
759 | - | let pmtA = $ | |
760 | - | let AId = $ | |
761 | - | let pmtB = $ | |
762 | - | let BId = $ | |
763 | - | let balA = $ | |
764 | - | let balB = $ | |
765 | - | let shareId = $ | |
766 | - | let bwAsset = $ | |
767 | - | let bwAmount = $ | |
835 | + | let $t02675126855 = parseRequest(requestId) | |
836 | + | let user = $t02675126855._1 | |
837 | + | let pool = $t02675126855._2 | |
838 | + | let pmtA = $t02675126855._3 | |
839 | + | let AId = $t02675126855._4 | |
840 | + | let pmtB = $t02675126855._5 | |
841 | + | let BId = $t02675126855._6 | |
842 | + | let balA = $t02675126855._7 | |
843 | + | let balB = $t02675126855._8 | |
844 | + | let shareId = $t02675126855._9 | |
845 | + | let bwAsset = $t02675126855._10 | |
846 | + | let bwAmount = $t02675126855._11 | |
768 | 847 | if ((size(i.payments) != 1)) | |
769 | 848 | then throw("Wrong payment size") | |
770 | 849 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
772 | 851 | else (i.payments[0].amount != bwAmount)) | |
773 | 852 | then throw("Wrong payment") | |
774 | 853 | else { | |
775 | - | let $ | |
854 | + | let $t02704527169 = if ((AId == bwAsset)) | |
776 | 855 | then $Tuple2((pmtA + i.payments[0].amount), pmtB) | |
777 | 856 | else $Tuple2(pmtA, (pmtB + i.payments[0].amount)) | |
778 | - | let pmtAllA = $ | |
779 | - | let pmtAllB = $ | |
857 | + | let pmtAllA = $t02704527169._1 | |
858 | + | let pmtAllB = $t02704527169._2 | |
780 | 859 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
781 | - | let $ | |
782 | - | let userStaked = $ | |
783 | - | let axlyFee = $ | |
860 | + | let $t02725127360 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
861 | + | let userStaked = $t02725127360._1 | |
862 | + | let axlyFee = $t02725127360._2 | |
784 | 863 | let posNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
785 | 864 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
786 | 865 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType) | |
809 | 888 | else throw(($getType(@) + " couldn't be cast to Int")) | |
810 | 889 | } | |
811 | 890 | else 0 | |
812 | - | let $ | |
813 | - | if (($ | |
891 | + | let $t02880228922 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset) | |
892 | + | if (($t02880228922 == $t02880228922)) | |
814 | 893 | then { | |
815 | - | let assetIdB = $ | |
816 | - | let toUserAmountB = $ | |
817 | - | let assetIdA = $ | |
818 | - | let toUserAmountA = $ | |
894 | + | let assetIdB = $t02880228922._4 | |
895 | + | let toUserAmountB = $t02880228922._3 | |
896 | + | let assetIdA = $t02880228922._2 | |
897 | + | let toUserAmountA = $t02880228922._1 | |
819 | 898 | let closeDbtInv = if ((debt > 0)) | |
820 | 899 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + toString(posId))], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
821 | 900 | else 0 | |
838 | 917 | ||
839 | 918 | @Callable(i) | |
840 | 919 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
841 | - | let $ | |
920 | + | let $t03021930413 = if (claim) | |
842 | 921 | then claimFarmed(type, pool) | |
843 | 922 | else { | |
844 | 923 | let claimedAsset = if ((type == SF_POOL)) | |
846 | 925 | else WXID | |
847 | 926 | $Tuple2(amountToExchange, claimedAsset) | |
848 | 927 | } | |
849 | - | let claimedAmount = $ | |
850 | - | let claimedAsset = $ | |
928 | + | let claimedAmount = $t03021930413._1 | |
929 | + | let claimedAsset = $t03021930413._2 | |
851 | 930 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
852 | 931 | let change = (claimedAmount - amountToExchange) | |
853 | 932 | let changeEntry = if ((change > 0)) | |
860 | 939 | ||
861 | 940 | @Callable(i) | |
862 | 941 | func capitalizeExPazzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
863 | - | let $ | |
942 | + | let $t03106931263 = if (claim) | |
864 | 943 | then claimFarmed(type, pool) | |
865 | 944 | else { | |
866 | 945 | let claimedAsset = if ((type == SF_POOL)) | |
868 | 947 | else WXID | |
869 | 948 | $Tuple2(amountToExchange, claimedAsset) | |
870 | 949 | } | |
871 | - | let claimedAmount = $ | |
872 | - | let claimedAsset = $ | |
950 | + | let claimedAmount = $t03106931263._1 | |
951 | + | let claimedAsset = $t03106931263._2 | |
873 | 952 | let exchangedAmount = exchangePazzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
874 | 953 | let change = (claimedAmount - amountToExchange) | |
875 | 954 | let changeEntry = if ((change > 0)) | |
882 | 961 | ||
883 | 962 | @Callable(i) | |
884 | 963 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
885 | - | let $ | |
964 | + | let $t03198632180 = if (claim) | |
886 | 965 | then claimFarmed(type, pool) | |
887 | 966 | else { | |
888 | 967 | let claimedAsset = if ((type == SF_POOL)) | |
890 | 969 | else WXID | |
891 | 970 | $Tuple2(amountToExchange, claimedAsset) | |
892 | 971 | } | |
893 | - | let claimedAmount = $ | |
894 | - | let claimedAsset = $ | |
972 | + | let claimedAmount = $t03198632180._1 | |
973 | + | let claimedAsset = $t03198632180._2 | |
895 | 974 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
896 | 975 | let change = (claimedAmount - amountToExchange) | |
897 | 976 | let changeEntry = if ((change > 0)) | |
903 | 982 | ||
904 | 983 | ||
905 | 984 | @Callable(i) | |
906 | - | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan, | |
985 | + | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan) = if (if ((type != SF_POOL)) | |
907 | 986 | then (type != WX_POOL) | |
908 | 987 | else false) | |
909 | 988 | then throw("Wrong type") | |
910 | - | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), IntegerEntry((poolAddr + kPoolInterest), 0), StringEntry((kPool + poolAddr), type)] | |
989 | + | else { | |
990 | + | let $t03282532919 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
991 | + | let aId = $t03282532919._1 | |
992 | + | let bId = $t03282532919._2 | |
993 | + | let aBal = $t03282532919._3 | |
994 | + | let bBal = $t03282532919._4 | |
995 | + | let shareId = $t03282532919._5 | |
996 | + | [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kPoolInterest), 0), StringEntry((kPool + poolAddr), type), StringEntry((shareId + kSharePool), poolAddr)] | |
997 | + | } | |
911 | 998 | ||
912 | 999 | ||
913 | 1000 | @Verifier(tx) |
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 | - | let CAP_FEE = "cap" | |
8 | + | let CAP_FEE_NO_LOAN = "capNoLoan" | |
9 | + | ||
10 | + | let CAP_FEE_LOAN = "capLoan" | |
9 | 11 | ||
10 | 12 | let LOAN_FEE = "loan" | |
11 | 13 | ||
12 | 14 | let NO_LOAN_FEE = "noLoan" | |
13 | 15 | ||
14 | 16 | let SCALE8 = 100000000 | |
15 | 17 | ||
16 | 18 | let SCALE10 = 10000000000 | |
17 | 19 | ||
18 | 20 | let FEE_SCALE6 = 1000000 | |
19 | 21 | ||
20 | 22 | let kSFPoolAAssetBalance = "A_asset_balance" | |
21 | 23 | ||
22 | 24 | let kSFPoolBAssetBalance = "B_asset_balance" | |
23 | 25 | ||
24 | 26 | let kSFPoolAAssetId = "A_asset_id" | |
25 | 27 | ||
26 | 28 | let kSFPoolBAssetId = "B_asset_id" | |
27 | 29 | ||
28 | 30 | let kSFPoolShareId = "share_asset_id" | |
29 | 31 | ||
30 | 32 | let kSFPoolFee = "commission" | |
31 | 33 | ||
32 | 34 | let kUserPosition = "_user_position" | |
33 | 35 | ||
34 | 36 | let kUserBorrowAmount = "_user_position_borrow_amount" | |
35 | 37 | ||
36 | 38 | let kUserBorrowAssetId = "_user_position_borrow_asset_id" | |
37 | 39 | ||
38 | 40 | let kUserPositionNum = "_user_position_number" | |
39 | 41 | ||
40 | 42 | let kUserPositionInterest = "_user_position_interest" | |
41 | 43 | ||
42 | 44 | let kPoolTotal = "_pool_total" | |
43 | 45 | ||
46 | + | let kPoolTotalLoan = "_pool_total_loan" | |
47 | + | ||
44 | 48 | let kPoolInterest = "_pool_interest" | |
45 | 49 | ||
46 | 50 | let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan" | |
47 | 51 | ||
48 | 52 | let kAxlyInFeeWithLoan = "_axly_fee_with_loan" | |
49 | 53 | ||
50 | - | let kAxlyCapFee = "_axly_fee_cap" | |
54 | + | let kAxlyNoLoanCapFee = "_axly_fee_cap_with_loan" | |
55 | + | ||
56 | + | let kAxlyWithLoanCapFee = "_axly_fee_cap_no_loan" | |
51 | 57 | ||
52 | 58 | let kRequestId = "_request_id" | |
53 | 59 | ||
54 | 60 | let kRequestIter = "requests_iter" | |
55 | 61 | ||
56 | 62 | let kPool = "pool_" | |
63 | + | ||
64 | + | let kSharePool = "_pool_share_id" | |
57 | 65 | ||
58 | 66 | let kPoolCapChange = "_pool_cap_change" | |
59 | 67 | ||
60 | 68 | let kMoneyBox = "axly_money_box" | |
61 | 69 | ||
62 | 70 | let kSFFarmingAddr = "swopfi_farming_addr" | |
63 | 71 | ||
64 | 72 | let kLendService = "lend_service_addr" | |
65 | 73 | ||
66 | 74 | let kPriceOracle = "price_oracle" | |
67 | 75 | ||
68 | 76 | let kExContract = "exchange_contract" | |
69 | 77 | ||
70 | 78 | let kWxSwapContract = "wx_swap_contract" | |
71 | 79 | ||
72 | 80 | let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address"))) | |
73 | 81 | ||
74 | 82 | let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address"))) | |
75 | 83 | ||
76 | 84 | let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address"))) | |
77 | 85 | ||
78 | 86 | let wxSwapContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kWxSwapContract), "No wx swap address"))) | |
79 | 87 | ||
80 | 88 | let SWOPID = base58'4W19ndijcc2CsQa9HGW2dfXKTVXhnneWWttxXrtjPmEp' | |
81 | 89 | ||
82 | 90 | let WXID = base58'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc' | |
83 | 91 | ||
84 | 92 | func isSelfCall (i) = if ((i.caller == this)) | |
85 | 93 | then unit | |
86 | 94 | else throw("Only contract itself can call this function") | |
87 | 95 | ||
88 | 96 | ||
89 | 97 | func accountBalance (assetId) = match assetId { | |
90 | 98 | case id: ByteVector => | |
91 | 99 | assetBalance(this, id) | |
92 | 100 | case waves: Unit => | |
93 | 101 | wavesBalance(this).available | |
94 | 102 | case _ => | |
95 | 103 | throw("Match error") | |
96 | 104 | } | |
97 | 105 | ||
98 | 106 | ||
99 | 107 | 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")) | |
100 | 108 | ||
101 | 109 | ||
102 | 110 | func getWXPoolData (poolAddr) = { | |
103 | 111 | let cfg = { | |
104 | 112 | let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil) | |
105 | 113 | if ($isInstanceOf(@, "List[Any]")) | |
106 | 114 | then @ | |
107 | 115 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
108 | 116 | } | |
109 | 117 | if ((cfg == cfg)) | |
110 | - | then $Tuple5(valueOrErrorMessage({ | |
111 | - | let @ = cfg[4] | |
112 | - | if ($isInstanceOf(@, "String")) | |
113 | - | then @ | |
114 | - | else unit | |
115 | - | }, "Can't get pool A asset id"), valueOrErrorMessage({ | |
116 | - | let @ = cfg[5] | |
117 | - | if ($isInstanceOf(@, "String")) | |
118 | - | then @ | |
119 | - | else unit | |
120 | - | }, "Can't get pool B asset id"), 0, 0, valueOrErrorMessage({ | |
121 | - | let @ = cfg[3] | |
122 | - | if ($isInstanceOf(@, "String")) | |
123 | - | then @ | |
124 | - | else unit | |
125 | - | }, "Can't get pool LP asset id")) | |
118 | + | then { | |
119 | + | let aId = valueOrErrorMessage({ | |
120 | + | let @ = cfg[4] | |
121 | + | if ($isInstanceOf(@, "String")) | |
122 | + | then @ | |
123 | + | else unit | |
124 | + | }, "Can't get pool A asset id") | |
125 | + | let bId = valueOrErrorMessage({ | |
126 | + | let @ = cfg[5] | |
127 | + | if ($isInstanceOf(@, "String")) | |
128 | + | then @ | |
129 | + | else unit | |
130 | + | }, "Can't get pool B asset id") | |
131 | + | let shareId = valueOrErrorMessage({ | |
132 | + | let @ = cfg[3] | |
133 | + | if ($isInstanceOf(@, "String")) | |
134 | + | then @ | |
135 | + | else unit | |
136 | + | }, "Can't get pool LP asset id") | |
137 | + | let balA = { | |
138 | + | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [aId], nil) | |
139 | + | if ($isInstanceOf(@, "Int")) | |
140 | + | then @ | |
141 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
142 | + | } | |
143 | + | if ((balA == balA)) | |
144 | + | then { | |
145 | + | let balB = { | |
146 | + | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [bId], nil) | |
147 | + | if ($isInstanceOf(@, "Int")) | |
148 | + | then @ | |
149 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
150 | + | } | |
151 | + | if ((balB == balB)) | |
152 | + | then $Tuple5(aId, bId, balA, balB, shareId) | |
153 | + | else throw("Strict value is not equal to itself.") | |
154 | + | } | |
155 | + | else throw("Strict value is not equal to itself.") | |
156 | + | } | |
126 | 157 | else throw("Strict value is not equal to itself.") | |
127 | 158 | } | |
128 | 159 | ||
129 | 160 | ||
130 | 161 | func getPoolData (poolAddr,type) = if ((type == SF_POOL)) | |
131 | 162 | then getSFPoolData(poolAddr) | |
132 | 163 | else if ((type == WX_POOL)) | |
133 | 164 | then getWXPoolData(poolAddr) | |
134 | 165 | else throw("Wrong pool type") | |
135 | 166 | ||
136 | 167 | ||
137 | 168 | func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0) | |
138 | 169 | ||
139 | 170 | ||
171 | + | func getPoolTotalShareWithLoan (pool) = valueOrElse(getInteger(this, (pool + kPoolTotalLoan)), 0) | |
172 | + | ||
173 | + | ||
140 | 174 | func getNewUserPositionNumber (pool,user) = (valueOrElse(getInteger(this, (((pool + "_") + user) + kUserPositionNum)), 0) + 1) | |
141 | 175 | ||
142 | 176 | ||
143 | - | func getAxlyFee (pool,feeType) = if ((feeType == "cap")) | |
144 | - | then getIntegerValue(this, (pool + kAxlyCapFee)) | |
145 | - | else if ((feeType == "loan")) | |
146 | - | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
147 | - | else if ((feeType == "noLoan")) | |
148 | - | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
149 | - | else throw("Wrong fee type") | |
177 | + | func getAxlyFee (pool,feeType) = if ((feeType == CAP_FEE_LOAN)) | |
178 | + | then getIntegerValue(this, (pool + kAxlyWithLoanCapFee)) | |
179 | + | else if ((feeType == CAP_FEE_NO_LOAN)) | |
180 | + | then getIntegerValue(this, (pool + kAxlyNoLoanCapFee)) | |
181 | + | else if ((feeType == LOAN_FEE)) | |
182 | + | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
183 | + | else if ((feeType == NO_LOAN_FEE)) | |
184 | + | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
185 | + | else throw("Wrong fee type") | |
150 | 186 | ||
151 | 187 | ||
152 | 188 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
153 | 189 | ||
154 | 190 | ||
155 | 191 | func getWXFarmingAddr (poolAddr) = { | |
156 | 192 | let fContract = Address(fromBase58String(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
157 | 193 | let factroyCfg = split(valueOrErrorMessage(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
158 | 194 | Address(fromBase58String(factroyCfg[1])) | |
159 | 195 | } | |
160 | 196 | ||
161 | 197 | ||
162 | 198 | func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr"))) | |
163 | 199 | ||
164 | 200 | ||
165 | 201 | func assetIdToStr (assetId) = match assetId { | |
166 | 202 | case id: ByteVector => | |
167 | 203 | toBase58String(id) | |
168 | 204 | case waves: Unit => | |
169 | 205 | "WAVES" | |
170 | 206 | case _ => | |
171 | 207 | throw("Match error") | |
172 | 208 | } | |
173 | 209 | ||
174 | 210 | ||
175 | 211 | func assetIdFromStr (assetId) = if ((assetId == "WAVES")) | |
176 | 212 | then unit | |
177 | 213 | else fromBase58String(assetId) | |
178 | 214 | ||
179 | 215 | ||
180 | 216 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
181 | 217 | then 8 | |
182 | 218 | else match assetInfo(fromBase58String(assetId)) { | |
183 | 219 | case asset: Asset => | |
184 | 220 | asset.decimals | |
185 | 221 | case _ => | |
186 | 222 | throw("Can't find asset") | |
187 | 223 | } | |
188 | 224 | ||
189 | 225 | ||
190 | 226 | func replenishSwopFi (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,balA,balB,shareId) = { | |
191 | 227 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
192 | 228 | if ((shareBalanceBefore == shareBalanceBefore)) | |
193 | 229 | then { | |
194 | 230 | let poolAddr = Address(fromBase58String(pool)) | |
195 | 231 | let ratioA = fraction(SCALE8, pmtA, balA) | |
196 | 232 | let ratioB = fraction(SCALE8, pmtB, balB) | |
197 | - | let $ | |
233 | + | let $t071357427 = if ((ratioB > ratioA)) | |
198 | 234 | then { | |
199 | 235 | let pmt = fraction(balB, ratioA, SCALE8, CEILING) | |
200 | 236 | $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB) | |
201 | 237 | } | |
202 | 238 | else { | |
203 | 239 | let pmt = fraction(balA, ratioB, SCALE8, CEILING) | |
204 | 240 | $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA) | |
205 | 241 | } | |
206 | - | let pmtAmountA = $ | |
207 | - | let pmtAmountB = $ | |
208 | - | let change = $ | |
209 | - | let changeAssetId = $ | |
242 | + | let pmtAmountA = $t071357427._1 | |
243 | + | let pmtAmountB = $t071357427._2 | |
244 | + | let change = $t071357427._3 | |
245 | + | let changeAssetId = $t071357427._4 | |
210 | 246 | let inv1 = if (if ((pmtAmountA > 0)) | |
211 | 247 | then (pmtAmountB > 0) | |
212 | 248 | else false) | |
213 | 249 | then { | |
214 | 250 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
215 | 251 | invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
216 | 252 | } | |
217 | 253 | else 0 | |
218 | 254 | if ((inv1 == inv1)) | |
219 | 255 | then { | |
220 | 256 | let inv2 = if ((change > 0)) | |
221 | 257 | then { | |
222 | 258 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
223 | 259 | let vars = ["0", "false", "0"] | |
224 | 260 | invoke(poolAddr, "callFunction", ["replenishWithOneToken", vars], payments) | |
225 | 261 | } | |
226 | 262 | else 0 | |
227 | 263 | if ((inv2 == inv2)) | |
228 | 264 | then { | |
229 | 265 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
230 | 266 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
231 | 267 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
232 | 268 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
233 | 269 | if ((0 >= userShareForStake)) | |
234 | 270 | then throw("amount of staked sharetokens must be > 0") | |
235 | 271 | else { | |
236 | 272 | let inv3 = invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
237 | 273 | if ((inv3 == inv3)) | |
238 | 274 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
239 | 275 | else throw("Strict value is not equal to itself.") | |
240 | 276 | } | |
241 | 277 | } | |
242 | 278 | else throw("Strict value is not equal to itself.") | |
243 | 279 | } | |
244 | 280 | else throw("Strict value is not equal to itself.") | |
245 | 281 | } | |
246 | 282 | else throw("Strict value is not equal to itself.") | |
247 | 283 | } | |
248 | 284 | ||
249 | 285 | ||
250 | 286 | func replenishWX (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,shareId) = { | |
251 | 287 | let poolAddr = Address(fromBase58String(pool)) | |
252 | - | let $ | |
288 | + | let $t088789727 = if (if ((pmtA > 0)) | |
253 | 289 | then (pmtB > 0) | |
254 | 290 | else false) | |
255 | 291 | then { | |
256 | 292 | let evalPutInA = split({ | |
257 | 293 | let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil) | |
258 | 294 | if ($isInstanceOf(@, "String")) | |
259 | 295 | then @ | |
260 | 296 | else throw(($getType(@) + " couldn't be cast to String")) | |
261 | 297 | }, "__") | |
262 | 298 | if ((evalPutInA == evalPutInA)) | |
263 | 299 | then { | |
264 | 300 | let evalPutInB = split({ | |
265 | 301 | let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil) | |
266 | 302 | if ($isInstanceOf(@, "String")) | |
267 | 303 | then @ | |
268 | 304 | else throw(($getType(@) + " couldn't be cast to String")) | |
269 | 305 | }, "__") | |
270 | 306 | if ((evalPutInB == evalPutInB)) | |
271 | 307 | then { | |
272 | 308 | let lpInA = parseIntValue(evalPutInA[1]) | |
273 | 309 | let lpInB = parseIntValue(evalPutInB[1]) | |
274 | 310 | if ((lpInB > lpInA)) | |
275 | 311 | then { | |
276 | 312 | let pmtInB = parseIntValue(evalPutInA[8]) | |
277 | 313 | $Tuple4(pmtA, pmtInB, (pmtB - pmtInB), pmtAssetB) | |
278 | 314 | } | |
279 | 315 | else { | |
280 | 316 | let pmtInA = parseIntValue(evalPutInB[7]) | |
281 | 317 | $Tuple4(pmtInA, pmtB, (pmtA - pmtInA), pmtAssetA) | |
282 | 318 | } | |
283 | 319 | } | |
284 | 320 | else throw("Strict value is not equal to itself.") | |
285 | 321 | } | |
286 | 322 | else throw("Strict value is not equal to itself.") | |
287 | 323 | } | |
288 | 324 | else if ((pmtA > 0)) | |
289 | 325 | then $Tuple4(pmtA, pmtB, pmtA, pmtAssetA) | |
290 | 326 | else if ((pmtB > 0)) | |
291 | 327 | then $Tuple4(pmtA, pmtB, pmtB, pmtAssetB) | |
292 | 328 | else throw("pmts must be > 0") | |
293 | - | let pmtAmountA = $ | |
294 | - | let pmtAmountB = $ | |
295 | - | let change = $ | |
296 | - | let changeAssetId = $ | |
329 | + | let pmtAmountA = $t088789727._1 | |
330 | + | let pmtAmountB = $t088789727._2 | |
331 | + | let change = $t088789727._3 | |
332 | + | let changeAssetId = $t088789727._4 | |
297 | 333 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
298 | 334 | if ((shareBalanceBefore == shareBalanceBefore)) | |
299 | 335 | then { | |
300 | 336 | let inv1 = if (if ((pmtAmountA > 0)) | |
301 | 337 | then (pmtAmountB > 0) | |
302 | 338 | else false) | |
303 | 339 | then { | |
304 | 340 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
305 | 341 | invoke(poolAddr, "put", [1000000, false], payments) | |
306 | 342 | } | |
307 | 343 | else 0 | |
308 | 344 | if ((inv1 == inv1)) | |
309 | 345 | then { | |
310 | 346 | let inv2 = if ((change > 0)) | |
311 | 347 | then { | |
312 | 348 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
313 | 349 | invoke(poolAddr, "putOneTkn", [0, false], payments) | |
314 | 350 | } | |
315 | 351 | else 0 | |
316 | 352 | if ((inv2 == inv2)) | |
317 | 353 | then { | |
318 | 354 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
319 | 355 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
320 | 356 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
321 | 357 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
322 | 358 | if ((0 >= userShareForStake)) | |
323 | 359 | then throw("amount of staked sharetokens must be > 0") | |
324 | 360 | else { | |
325 | 361 | let inv3 = invoke(getWXFarmingAddr(poolAddr), "stake", nil, [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
326 | 362 | if ((inv3 == inv3)) | |
327 | 363 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
328 | 364 | else throw("Strict value is not equal to itself.") | |
329 | 365 | } | |
330 | 366 | } | |
331 | 367 | else throw("Strict value is not equal to itself.") | |
332 | 368 | } | |
333 | 369 | else throw("Strict value is not equal to itself.") | |
334 | 370 | } | |
335 | 371 | else throw("Strict value is not equal to itself.") | |
336 | 372 | } | |
337 | 373 | ||
338 | 374 | ||
339 | 375 | func replenishByType (type,pool,feeType,pmtA,AId,pmtB,BId,balA,balB,shareId) = if ((type == SF_POOL)) | |
340 | 376 | then replenishSwopFi(pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
341 | 377 | else if ((type == WX_POOL)) | |
342 | 378 | then replenishWX(pool, LOAN_FEE, pmtA, AId, pmtB, BId, shareId) | |
343 | 379 | else throw("Wrong pool type") | |
344 | 380 | ||
345 | 381 | ||
346 | 382 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type) = { | |
347 | 383 | let totalAmount = getPoolTotalShare(pool) | |
384 | + | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
348 | 385 | let curPoolInterest = getIntegerValue(this, (pool + kPoolInterest)) | |
349 | - | [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))] | |
386 | + | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), (totalAmountLoan + 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))] | |
350 | 387 | } | |
351 | 388 | ||
352 | 389 | ||
353 | 390 | func claimFarmed (type,pool) = if ((type == SF_POOL)) | |
354 | 391 | then { | |
355 | 392 | let balBefore = accountBalance(SWOPID) | |
356 | 393 | if ((balBefore == balBefore)) | |
357 | 394 | then { | |
358 | 395 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
359 | 396 | if ((inv == inv)) | |
360 | 397 | then { | |
361 | 398 | let balAfter = accountBalance(SWOPID) | |
362 | 399 | $Tuple2((balAfter - balBefore), SWOPID) | |
363 | 400 | } | |
364 | 401 | else throw("Strict value is not equal to itself.") | |
365 | 402 | } | |
366 | 403 | else throw("Strict value is not equal to itself.") | |
367 | 404 | } | |
368 | 405 | else if ((type == WX_POOL)) | |
369 | 406 | then { | |
370 | 407 | let balBefore = accountBalance(WXID) | |
371 | 408 | if ((balBefore == balBefore)) | |
372 | 409 | then { | |
373 | 410 | let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil) | |
374 | 411 | if ((inv == inv)) | |
375 | 412 | then { | |
376 | 413 | let balAfter = accountBalance(WXID) | |
377 | 414 | $Tuple2((balAfter - balBefore), WXID) | |
378 | 415 | } | |
379 | 416 | else throw("Strict value is not equal to itself.") | |
380 | 417 | } | |
381 | 418 | else throw("Strict value is not equal to itself.") | |
382 | 419 | } | |
383 | 420 | else throw("Wrong pool type") | |
384 | 421 | ||
385 | 422 | ||
386 | 423 | func exchangeKeeper (toToken,pmtAmount,pmtAsset,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
387 | 424 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
388 | 425 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
389 | 426 | then { | |
390 | 427 | let inv = invoke(exContract, "swap", [amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
391 | 428 | if ((inv == inv)) | |
392 | 429 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
393 | 430 | else throw("Strict value is not equal to itself.") | |
394 | 431 | } | |
395 | 432 | else throw("Strict value is not equal to itself.") | |
396 | 433 | } | |
397 | 434 | ||
398 | 435 | ||
399 | 436 | func exchangePazzle (toToken,pmtAmount,pmtAsset,routesStr,minToReceive,options) = { | |
400 | 437 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
401 | 438 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
402 | 439 | then { | |
403 | 440 | let inv = invoke(exContract, "puzzleSwap", [routesStr, minToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
404 | 441 | if ((inv == inv)) | |
405 | 442 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
406 | 443 | else throw("Strict value is not equal to itself.") | |
407 | 444 | } | |
408 | 445 | else throw("Strict value is not equal to itself.") | |
409 | 446 | } | |
410 | 447 | ||
411 | 448 | ||
412 | 449 | func exchangeSwopFi (toToken,pmtAmount,pmtAsset,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
413 | 450 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
414 | 451 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
415 | 452 | then { | |
416 | 453 | let inv = invoke(exContract, "swopfiSwap", [exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
417 | 454 | if ((inv == inv)) | |
418 | 455 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
419 | 456 | else throw("Strict value is not equal to itself.") | |
420 | 457 | } | |
421 | 458 | else throw("Strict value is not equal to itself.") | |
422 | 459 | } | |
423 | 460 | ||
424 | 461 | ||
425 | 462 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
426 | 463 | let poolAddr = Address(fromBase58String(pool)) | |
427 | - | let $ | |
428 | - | let AId = $ | |
429 | - | let BId = $ | |
430 | - | let balA = $ | |
431 | - | let balB = $ | |
432 | - | let shareId = $ | |
433 | - | let $ | |
464 | + | let $t01469114770 = getPoolData(poolAddr, pType) | |
465 | + | let AId = $t01469114770._1 | |
466 | + | let BId = $t01469114770._2 | |
467 | + | let balA = $t01469114770._3 | |
468 | + | let balB = $t01469114770._4 | |
469 | + | let shareId = $t01469114770._5 | |
470 | + | let $t01477314853 = if ((tokenId == AId)) | |
434 | 471 | then $Tuple2(tokenAmount, 0) | |
435 | 472 | else $Tuple2(0, tokenAmount) | |
436 | - | let pmtA = $ | |
437 | - | let pmtB = $ | |
438 | - | let $ | |
439 | - | let stakedAmount = $ | |
440 | - | let axlyFee = $ | |
473 | + | let pmtA = $t01477314853._1 | |
474 | + | let pmtB = $t01477314853._2 | |
475 | + | let $t01485614971 = replenishByType(pType, pool, CAP_FEE_LOAN, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
476 | + | let stakedAmount = $t01485614971._1 | |
477 | + | let axlyFee = $t01485614971._2 | |
441 | 478 | let curPoolInterest = valueOrElse(getInteger(this, (pool + kPoolInterest)), 0) | |
442 | 479 | let totalShareAmount = getPoolTotalShare(pool) | |
443 | 480 | let newInterest = (curPoolInterest + fraction(stakedAmount, SCALE10, totalShareAmount)) | |
444 | 481 | [IntegerEntry((pool + kPoolInterest), newInterest), ScriptTransfer(moneyBox, axlyFee, fromBase58String(shareId))] | |
445 | 482 | } | |
446 | 483 | ||
447 | 484 | ||
448 | 485 | func exchangeDirectlySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
449 | 486 | let poolAddr = Address(fromBase58String(pool)) | |
450 | 487 | let feeScale6 = 1000000 | |
451 | 488 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
452 | 489 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee)) | |
453 | - | let $ | |
490 | + | let $t01566415952 = if ((assetTokenToGet == assetIdA)) | |
454 | 491 | then { | |
455 | 492 | let amountToPay = fraction(balA, amntGetNoFee, (balB - amntGetNoFee)) | |
456 | 493 | $Tuple2(amountToPay, assetIdB) | |
457 | 494 | } | |
458 | 495 | else { | |
459 | 496 | let amountToPay = fraction(balB, amntGetNoFee, (balA - amntGetNoFee)) | |
460 | 497 | $Tuple2(amountToPay, assetIdA) | |
461 | 498 | } | |
462 | - | let amountToPay = $ | |
463 | - | let assetToPay = $ | |
499 | + | let amountToPay = $t01566415952._1 | |
500 | + | let assetToPay = $t01566415952._2 | |
464 | 501 | invoke(poolAddr, "callFunction", ["exchange", ["1"]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
465 | 502 | } | |
466 | 503 | ||
467 | 504 | ||
468 | 505 | func exchangeDirectlyWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
469 | 506 | let poolAddr = Address(fromBase58String(pool)) | |
470 | 507 | let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee") | |
471 | 508 | let pFee = getIntegerValue(wxSwapContract, "%s__poolFee") | |
472 | 509 | let feeScale = toBigInt(100000000) | |
473 | - | let $ | |
510 | + | let $t01643116739 = if ((assetTokenToGet == assetIdA)) | |
474 | 511 | then { | |
475 | 512 | let amountToPay = fraction(balA, amountTokenToGet, (balB - amountTokenToGet)) | |
476 | 513 | $Tuple2(amountToPay, assetIdB) | |
477 | 514 | } | |
478 | 515 | else { | |
479 | 516 | let amountToPay = fraction(balB, amountTokenToGet, (balA - amountTokenToGet)) | |
480 | 517 | $Tuple2(amountToPay, assetIdA) | |
481 | 518 | } | |
482 | - | let amountToPay = $ | |
483 | - | let assetToPay = $ | |
519 | + | let amountToPay = $t01643116739._1 | |
520 | + | let assetToPay = $t01643116739._2 | |
484 | 521 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))))) | |
485 | 522 | invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPayWithFee)]) | |
486 | 523 | } | |
487 | 524 | ||
488 | 525 | ||
489 | 526 | func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL)) | |
490 | 527 | then exchangeDirectlySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
491 | 528 | else exchangeDirectlyWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
492 | 529 | ||
493 | 530 | ||
494 | 531 | func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = { | |
495 | 532 | let poolAddr = Address(fromBase58String(pool)) | |
496 | 533 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
497 | - | let $ | |
498 | - | let assetIdA = $ | |
499 | - | let assetIdB = $ | |
500 | - | let balA = $ | |
501 | - | let balB = $ | |
534 | + | let $t01760417671 = getPoolData(poolAddr, pType) | |
535 | + | let assetIdA = $t01760417671._1 | |
536 | + | let assetIdB = $t01760417671._2 | |
537 | + | let balA = $t01760417671._3 | |
538 | + | let balB = $t01760417671._4 | |
502 | 539 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
503 | 540 | if ((cBalABefore == cBalABefore)) | |
504 | 541 | then { | |
505 | 542 | let cBalBBefore = accountBalance(assetIdFromStr(assetIdB)) | |
506 | 543 | if ((cBalBBefore == cBalBBefore)) | |
507 | 544 | then { | |
508 | 545 | let inv = if ((pType == SF_POOL)) | |
509 | 546 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
510 | 547 | else if ((pType == WX_POOL)) | |
511 | 548 | then invoke(poolAddr, "unstakeAndGet", [userCanWithdraw], nil) | |
512 | 549 | else throw("Wrong position type") | |
513 | 550 | if ((inv == inv)) | |
514 | 551 | then { | |
515 | 552 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
516 | 553 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
517 | - | let $ | |
518 | - | let tokensAmountA = $ | |
519 | - | let tokensAmountB = $ | |
520 | - | let $ | |
554 | + | let $t01818318272 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
555 | + | let tokensAmountA = $t01818318272._1 | |
556 | + | let tokensAmountB = $t01818318272._2 | |
557 | + | let $t01827518971 = if ((debt > 0)) | |
521 | 558 | then { | |
522 | 559 | let amountToGetEx = if (if ((borrowAsset == assetIdA)) | |
523 | 560 | then (debt > tokensAmountA) | |
524 | 561 | else false) | |
525 | 562 | then (debt - tokensAmountA) | |
526 | 563 | else if (if ((borrowAsset == assetIdB)) | |
527 | 564 | then (debt > tokensAmountB) | |
528 | 565 | else false) | |
529 | 566 | then (debt - tokensAmountB) | |
530 | 567 | else 0 | |
531 | 568 | let exInv = if ((amountToGetEx > 0)) | |
532 | 569 | then exchangeDirectly(pType, pool, assetIdA, assetIdB, balA, balB, amountToGetEx, borrowAsset) | |
533 | 570 | else 0 | |
534 | 571 | if ((exInv == exInv)) | |
535 | 572 | then { | |
536 | 573 | let cBalAAfterRepay = accountBalance(assetIdFromStr(assetIdA)) | |
537 | 574 | let cBalBAfterRepay = accountBalance(assetIdFromStr(assetIdB)) | |
538 | 575 | $Tuple2((cBalAAfterRepay - cBalABefore), (cBalBAfterRepay - cBalBBefore)) | |
539 | 576 | } | |
540 | 577 | else throw("Strict value is not equal to itself.") | |
541 | 578 | } | |
542 | 579 | else $Tuple2(tokensAmountA, tokensAmountB) | |
543 | - | let toUserAmountA = $ | |
544 | - | let toUserAmountB = $ | |
545 | - | $ | |
580 | + | let toUserAmountA = $t01827518971._1 | |
581 | + | let toUserAmountB = $t01827518971._2 | |
582 | + | $Tuple6(toUserAmountA, assetIdA, toUserAmountB, assetIdB, cBalAAfter, cBalBAfter) | |
546 | 583 | } | |
547 | 584 | else throw("Strict value is not equal to itself.") | |
548 | 585 | } | |
549 | 586 | else throw("Strict value is not equal to itself.") | |
550 | 587 | } | |
551 | 588 | else throw("Strict value is not equal to itself.") | |
552 | 589 | } | |
553 | 590 | ||
554 | 591 | ||
555 | 592 | func parseRequest (requestId) = { | |
556 | 593 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
557 | 594 | let user = request[0] | |
558 | 595 | let pool = request[1] | |
559 | 596 | let pmtA = parseIntValue(request[2]) | |
560 | 597 | let AId = request[3] | |
561 | 598 | let pmtB = parseIntValue(request[4]) | |
562 | 599 | let BId = request[5] | |
563 | 600 | let balA = parseIntValue(request[6]) | |
564 | 601 | let balB = parseIntValue(request[7]) | |
565 | 602 | let shareId = request[8] | |
566 | 603 | let bwAsset = request[9] | |
567 | 604 | let bwAmount = parseIntValue(request[10]) | |
568 | 605 | $Tuple11(user, pool, pmtA, AId, pmtB, BId, balA, balB, shareId, bwAsset, bwAmount) | |
569 | 606 | } | |
570 | 607 | ||
571 | 608 | ||
572 | 609 | @Callable(i) | |
610 | + | func getAssetPrice (assetId) = $Tuple2(nil, (let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil) | |
611 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
612 | + | then @ | |
613 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2) | |
614 | + | ||
615 | + | ||
616 | + | ||
617 | + | @Callable(i) | |
618 | + | func getSharePrice (shareId) = { | |
619 | + | let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id") | |
620 | + | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
621 | + | let $t02006620136 = getPoolData(Address(fromBase58String(pool)), pType) | |
622 | + | let aId = $t02006620136._1 | |
623 | + | let bId = $t02006620136._2 | |
624 | + | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [aId, false], nil) | |
625 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
626 | + | then @ | |
627 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
628 | + | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [bId, false], nil) | |
629 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
630 | + | then @ | |
631 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
632 | + | $Tuple2(nil, (dPriceA + dPriceB)) | |
633 | + | } | |
634 | + | ||
635 | + | ||
636 | + | ||
637 | + | @Callable(i) | |
573 | 638 | func replenishEVALONLY (pool,leverage,borrowAssetId) = if (if ((100 > leverage)) | |
574 | 639 | then true | |
575 | 640 | else (leverage > 300)) | |
576 | 641 | then throw("Leverage can't be <100 and >300") | |
577 | 642 | else { | |
578 | 643 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
579 | - | let $ | |
580 | - | let AId = $ | |
581 | - | let BId = $ | |
582 | - | let balA = $ | |
583 | - | let balB = $ | |
584 | - | let shareId = $ | |
585 | - | let $ | |
644 | + | let $t02062120711 = getPoolData(Address(fromBase58String(pool)), pType) | |
645 | + | let AId = $t02062120711._1 | |
646 | + | let BId = $t02062120711._2 | |
647 | + | let balA = $t02062120711._3 | |
648 | + | let balB = $t02062120711._4 | |
649 | + | let shareId = $t02062120711._5 | |
650 | + | let $t02071421351 = if ((size(i.payments) == 2)) | |
586 | 651 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
587 | 652 | then throw("Wrong payment asset A") | |
588 | 653 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
589 | 654 | then throw("Wrong payment asset B") | |
590 | 655 | else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId) | |
591 | 656 | else if ((size(i.payments) == 1)) | |
592 | 657 | then if ((assetIdToStr(i.payments[0].assetId) == AId)) | |
593 | 658 | then $Tuple4(i.payments[0].amount, AId, 0, BId) | |
594 | 659 | else if ((assetIdToStr(i.payments[0].assetId) == BId)) | |
595 | 660 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
596 | 661 | else throw("Wrong payment") | |
597 | 662 | else throw("One or two payments expected") | |
598 | - | let pmtA = $ | |
599 | - | let pmtAssetA = $ | |
600 | - | let pmtB = $ | |
601 | - | let pmtAssetB = $ | |
602 | - | let $ | |
663 | + | let pmtA = $t02071421351._1 | |
664 | + | let pmtAssetA = $t02071421351._2 | |
665 | + | let pmtB = $t02071421351._3 | |
666 | + | let pmtAssetB = $t02071421351._4 | |
667 | + | let $t02135422805 = if ((leverage > 100)) | |
603 | 668 | then { | |
604 | 669 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
605 | 670 | if ($isInstanceOf(@, "(Int, Int)")) | |
606 | 671 | then @ | |
607 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._ | |
672 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
608 | 673 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetB, false], nil) | |
609 | 674 | if ($isInstanceOf(@, "(Int, Int)")) | |
610 | 675 | then @ | |
611 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._ | |
676 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
612 | 677 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(pmtAssetA), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(pmtAssetB), 0, 0, DOWN))) | |
613 | 678 | let borrowAmount = fraction(paydInDollar, (leverage - 100), 100) | |
614 | 679 | let request = makeString([toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowAssetId, toString(borrowAmount), toString(1)], ",") | |
615 | 680 | let newRequestId = { | |
616 | 681 | let @ = invoke(this, "createNewRequest", [request], nil) | |
617 | 682 | if ($isInstanceOf(@, "Int")) | |
618 | 683 | then @ | |
619 | 684 | else throw(($getType(@) + " couldn't be cast to Int")) | |
620 | 685 | } | |
621 | 686 | if ((newRequestId == newRequestId)) | |
622 | 687 | then { | |
623 | 688 | let args = [((toString(i.caller) + "_") + toString(1)), shareId, borrowAssetId, borrowAmount, toString(this), "replenishFromLandReadOnly", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
624 | 689 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
625 | 690 | if ((inv == inv)) | |
626 | 691 | then $Tuple2(getIntegerValue(this, "EVALONLY_STAKEDAMOUNT"), borrowAmount) | |
627 | 692 | else throw("Strict value is not equal to itself.") | |
628 | 693 | } | |
629 | 694 | else throw("Strict value is not equal to itself.") | |
630 | 695 | } | |
631 | 696 | else $Tuple2(replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)._1, 0) | |
632 | - | let userStaked = $ | |
633 | - | let borrowAmount = $ | |
634 | - | let $ | |
635 | - | if (($ | |
697 | + | let userStaked = $t02135422805._1 | |
698 | + | let borrowAmount = $t02135422805._2 | |
699 | + | let $t02280922976 = withdrawAmountCalc(pool, userStaked, borrowAmount, borrowAssetId) | |
700 | + | if (($t02280922976 == $t02280922976)) | |
636 | 701 | then { | |
637 | - | let assetIdB = $t02124121366._4 | |
638 | - | let toUserAmountB = $t02124121366._3 | |
639 | - | let assetIdA = $t02124121366._2 | |
640 | - | let toUserAmountA = $t02124121366._1 | |
641 | - | $Tuple2(nil, [userStaked, toUserAmountA, toUserAmountB]) | |
702 | + | let userGetBBeforeRepay = $t02280922976._6 | |
703 | + | let userGetABeforeRepay = $t02280922976._5 | |
704 | + | let assetIdB = $t02280922976._4 | |
705 | + | let toUserAmountB = $t02280922976._3 | |
706 | + | let assetIdA = $t02280922976._2 | |
707 | + | let toUserAmountA = $t02280922976._1 | |
708 | + | let $t02297923094 = getPoolData(Address(fromBase58String(pool)), pType) | |
709 | + | let AIdAfter = $t02297923094._1 | |
710 | + | let BIdAfter = $t02297923094._2 | |
711 | + | let balAAfter = $t02297923094._3 | |
712 | + | let balBAfter = $t02297923094._4 | |
713 | + | let shareIdAfter = $t02297923094._5 | |
714 | + | let ratioBefore = fraction(balB, SCALE8, balA) | |
715 | + | let ratioAfter = fraction(balBAfter, SCALE8, balAAfter) | |
716 | + | let impact = (SCALE8 - fraction(ratioBefore, SCALE8, ratioAfter)) | |
717 | + | let imcatMod = if ((0 > impact)) | |
718 | + | then (impact * -1) | |
719 | + | else impact | |
720 | + | $Tuple2(nil, [userGetABeforeRepay, userGetBBeforeRepay, imcatMod]) | |
642 | 721 | } | |
643 | 722 | else throw("Strict value is not equal to itself.") | |
644 | 723 | } | |
645 | 724 | ||
646 | 725 | ||
647 | 726 | ||
648 | 727 | @Callable(i) | |
649 | 728 | func replenishFromLandEVALONLY (requestId) = { | |
650 | - | let $ | |
651 | - | let user = $ | |
652 | - | let pool = $ | |
653 | - | let pmtA = $ | |
654 | - | let AId = $ | |
655 | - | let pmtB = $ | |
656 | - | let BId = $ | |
657 | - | let balA = $ | |
658 | - | let balB = $ | |
659 | - | let shareId = $ | |
660 | - | let bwAsset = $ | |
661 | - | let bwAmount = $ | |
729 | + | let $t02346423568 = parseRequest(requestId) | |
730 | + | let user = $t02346423568._1 | |
731 | + | let pool = $t02346423568._2 | |
732 | + | let pmtA = $t02346423568._3 | |
733 | + | let AId = $t02346423568._4 | |
734 | + | let pmtB = $t02346423568._5 | |
735 | + | let BId = $t02346423568._6 | |
736 | + | let balA = $t02346423568._7 | |
737 | + | let balB = $t02346423568._8 | |
738 | + | let shareId = $t02346423568._9 | |
739 | + | let bwAsset = $t02346423568._10 | |
740 | + | let bwAmount = $t02346423568._11 | |
662 | 741 | if ((size(i.payments) != 1)) | |
663 | 742 | then throw("Wrong payment size") | |
664 | 743 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
665 | 744 | then true | |
666 | 745 | else (i.payments[0].amount != bwAmount)) | |
667 | 746 | then throw("Wrong payment") | |
668 | 747 | else { | |
669 | - | let $ | |
748 | + | let $t02375823882 = if ((AId == bwAsset)) | |
670 | 749 | then $Tuple2((pmtA + i.payments[0].amount), pmtB) | |
671 | 750 | else $Tuple2(pmtA, (pmtB + i.payments[0].amount)) | |
672 | - | let pmtAllA = $ | |
673 | - | let pmtAllB = $ | |
751 | + | let pmtAllA = $t02375823882._1 | |
752 | + | let pmtAllB = $t02375823882._2 | |
674 | 753 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
675 | - | let $ | |
676 | - | let userStaked = $ | |
677 | - | let axlyFee = $ | |
754 | + | let $t02396424073 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
755 | + | let userStaked = $t02396424073._1 | |
756 | + | let axlyFee = $t02396424073._2 | |
678 | 757 | $Tuple2([IntegerEntry("EVALONLY_STAKEDAMOUNT", userStaked)], userStaked) | |
679 | 758 | } | |
680 | 759 | } | |
681 | 760 | ||
682 | 761 | ||
683 | 762 | ||
684 | 763 | @Callable(i) | |
685 | 764 | func replenish (pool,leverage,borrowAssetId) = if (if ((100 > leverage)) | |
686 | 765 | then true | |
687 | 766 | else (leverage > 300)) | |
688 | 767 | then throw("Leverage can't be <100 and >300") | |
689 | 768 | else { | |
690 | 769 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
691 | - | let $ | |
692 | - | let AId = $ | |
693 | - | let BId = $ | |
694 | - | let balA = $ | |
695 | - | let balB = $ | |
696 | - | let shareId = $ | |
697 | - | let $ | |
770 | + | let $t02445024540 = getPoolData(Address(fromBase58String(pool)), pType) | |
771 | + | let AId = $t02445024540._1 | |
772 | + | let BId = $t02445024540._2 | |
773 | + | let balA = $t02445024540._3 | |
774 | + | let balB = $t02445024540._4 | |
775 | + | let shareId = $t02445024540._5 | |
776 | + | let $t02454325180 = if ((size(i.payments) == 2)) | |
698 | 777 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
699 | 778 | then throw("Wrong payment asset A") | |
700 | 779 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
701 | 780 | then throw("Wrong payment asset B") | |
702 | 781 | else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId) | |
703 | 782 | else if ((size(i.payments) == 1)) | |
704 | 783 | then if ((assetIdToStr(i.payments[0].assetId) == AId)) | |
705 | 784 | then $Tuple4(i.payments[0].amount, AId, 0, BId) | |
706 | 785 | else if ((assetIdToStr(i.payments[0].assetId) == BId)) | |
707 | 786 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
708 | 787 | else throw("Wrong payment") | |
709 | 788 | else throw("One or two payments expected") | |
710 | - | let pmtA = $ | |
711 | - | let pmtAssetA = $ | |
712 | - | let pmtB = $ | |
713 | - | let pmtAssetB = $ | |
789 | + | let pmtA = $t02454325180._1 | |
790 | + | let pmtAssetA = $t02454325180._2 | |
791 | + | let pmtB = $t02454325180._3 | |
792 | + | let pmtAssetB = $t02454325180._4 | |
714 | 793 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
715 | 794 | if ((leverage > 100)) | |
716 | 795 | then { | |
717 | 796 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
718 | 797 | if ($isInstanceOf(@, "(Int, Int)")) | |
719 | 798 | then @ | |
720 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._ | |
799 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
721 | 800 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetB, false], nil) | |
722 | 801 | if ($isInstanceOf(@, "(Int, Int)")) | |
723 | 802 | then @ | |
724 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._ | |
803 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2 | |
725 | 804 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(pmtAssetA), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(pmtAssetB), 0, 0, DOWN))) | |
726 | 805 | let borrowAmount = fraction(paydInDollar, (leverage - 100), 100) | |
727 | 806 | let request = makeString([toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowAssetId, toString(borrowAmount)], ",") | |
728 | 807 | let newRequestId = { | |
729 | 808 | let @ = invoke(this, "createNewRequest", [request], nil) | |
730 | 809 | if ($isInstanceOf(@, "Int")) | |
731 | 810 | then @ | |
732 | 811 | else throw(($getType(@) + " couldn't be cast to Int")) | |
733 | 812 | } | |
734 | 813 | if ((newRequestId == newRequestId)) | |
735 | 814 | then { | |
736 | 815 | let args = [((toString(i.caller) + "_") + toString(newPosNum)), shareId, borrowAssetId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
737 | 816 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
738 | 817 | if ((inv == inv)) | |
739 | 818 | then nil | |
740 | 819 | else throw("Strict value is not equal to itself.") | |
741 | 820 | } | |
742 | 821 | else throw("Strict value is not equal to itself.") | |
743 | 822 | } | |
744 | 823 | else { | |
745 | - | let $ | |
746 | - | let userStaked = $ | |
747 | - | let axlyFee = $ | |
824 | + | let $t02647726589 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
825 | + | let userStaked = $t02647726589._1 | |
826 | + | let axlyFee = $t02647726589._2 | |
748 | 827 | replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, pType) | |
749 | 828 | } | |
750 | 829 | } | |
751 | 830 | ||
752 | 831 | ||
753 | 832 | ||
754 | 833 | @Callable(i) | |
755 | 834 | func replenishFromLand (requestId) = { | |
756 | - | let $ | |
757 | - | let user = $ | |
758 | - | let pool = $ | |
759 | - | let pmtA = $ | |
760 | - | let AId = $ | |
761 | - | let pmtB = $ | |
762 | - | let BId = $ | |
763 | - | let balA = $ | |
764 | - | let balB = $ | |
765 | - | let shareId = $ | |
766 | - | let bwAsset = $ | |
767 | - | let bwAmount = $ | |
835 | + | let $t02675126855 = parseRequest(requestId) | |
836 | + | let user = $t02675126855._1 | |
837 | + | let pool = $t02675126855._2 | |
838 | + | let pmtA = $t02675126855._3 | |
839 | + | let AId = $t02675126855._4 | |
840 | + | let pmtB = $t02675126855._5 | |
841 | + | let BId = $t02675126855._6 | |
842 | + | let balA = $t02675126855._7 | |
843 | + | let balB = $t02675126855._8 | |
844 | + | let shareId = $t02675126855._9 | |
845 | + | let bwAsset = $t02675126855._10 | |
846 | + | let bwAmount = $t02675126855._11 | |
768 | 847 | if ((size(i.payments) != 1)) | |
769 | 848 | then throw("Wrong payment size") | |
770 | 849 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
771 | 850 | then true | |
772 | 851 | else (i.payments[0].amount != bwAmount)) | |
773 | 852 | then throw("Wrong payment") | |
774 | 853 | else { | |
775 | - | let $ | |
854 | + | let $t02704527169 = if ((AId == bwAsset)) | |
776 | 855 | then $Tuple2((pmtA + i.payments[0].amount), pmtB) | |
777 | 856 | else $Tuple2(pmtA, (pmtB + i.payments[0].amount)) | |
778 | - | let pmtAllA = $ | |
779 | - | let pmtAllB = $ | |
857 | + | let pmtAllA = $t02704527169._1 | |
858 | + | let pmtAllB = $t02704527169._2 | |
780 | 859 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
781 | - | let $ | |
782 | - | let userStaked = $ | |
783 | - | let axlyFee = $ | |
860 | + | let $t02725127360 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
861 | + | let userStaked = $t02725127360._1 | |
862 | + | let axlyFee = $t02725127360._2 | |
784 | 863 | let posNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
785 | 864 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
786 | 865 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType) | |
787 | 866 | $Tuple2(((entries ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
788 | 867 | } | |
789 | 868 | } | |
790 | 869 | ||
791 | 870 | ||
792 | 871 | ||
793 | 872 | @Callable(i) | |
794 | 873 | func withdraw (pool,posId) = { | |
795 | 874 | let user = toString(i.caller) | |
796 | 875 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), "Unknown position") | |
797 | 876 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)) | |
798 | 877 | let poolInterst = getIntegerValue(this, (pool + kPoolInterest)) | |
799 | 878 | let poolTotalShare = getPoolTotalShare(pool) | |
800 | 879 | let userCanWithdraw = (pAmount + fraction(pAmount, (poolInterst - userInterest), SCALE10)) | |
801 | 880 | let userAddr = Address(fromBase58String(user)) | |
802 | 881 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAmount)) | |
803 | 882 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAssetId)) | |
804 | 883 | let debt = if ((borrowAmount > 0)) | |
805 | 884 | then { | |
806 | 885 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((((pool + "_") + user) + "_") + toString(posId)), borrowAsset], nil) | |
807 | 886 | if ($isInstanceOf(@, "Int")) | |
808 | 887 | then @ | |
809 | 888 | else throw(($getType(@) + " couldn't be cast to Int")) | |
810 | 889 | } | |
811 | 890 | else 0 | |
812 | - | let $ | |
813 | - | if (($ | |
891 | + | let $t02880228922 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset) | |
892 | + | if (($t02880228922 == $t02880228922)) | |
814 | 893 | then { | |
815 | - | let assetIdB = $ | |
816 | - | let toUserAmountB = $ | |
817 | - | let assetIdA = $ | |
818 | - | let toUserAmountA = $ | |
894 | + | let assetIdB = $t02880228922._4 | |
895 | + | let toUserAmountB = $t02880228922._3 | |
896 | + | let assetIdA = $t02880228922._2 | |
897 | + | let toUserAmountA = $t02880228922._1 | |
819 | 898 | let closeDbtInv = if ((debt > 0)) | |
820 | 899 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + toString(posId))], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
821 | 900 | else 0 | |
822 | 901 | if ((closeDbtInv == closeDbtInv)) | |
823 | 902 | then [DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, toUserAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, toUserAmountB, assetIdFromStr(assetIdB))] | |
824 | 903 | else throw("Strict value is not equal to itself.") | |
825 | 904 | } | |
826 | 905 | else throw("Strict value is not equal to itself.") | |
827 | 906 | } | |
828 | 907 | ||
829 | 908 | ||
830 | 909 | ||
831 | 910 | @Callable(i) | |
832 | 911 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
833 | 912 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
834 | 913 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId) | |
835 | 914 | }) | |
836 | 915 | ||
837 | 916 | ||
838 | 917 | ||
839 | 918 | @Callable(i) | |
840 | 919 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
841 | - | let $ | |
920 | + | let $t03021930413 = if (claim) | |
842 | 921 | then claimFarmed(type, pool) | |
843 | 922 | else { | |
844 | 923 | let claimedAsset = if ((type == SF_POOL)) | |
845 | 924 | then SWOPID | |
846 | 925 | else WXID | |
847 | 926 | $Tuple2(amountToExchange, claimedAsset) | |
848 | 927 | } | |
849 | - | let claimedAmount = $ | |
850 | - | let claimedAsset = $ | |
928 | + | let claimedAmount = $t03021930413._1 | |
929 | + | let claimedAsset = $t03021930413._2 | |
851 | 930 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
852 | 931 | let change = (claimedAmount - amountToExchange) | |
853 | 932 | let changeEntry = if ((change > 0)) | |
854 | 933 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
855 | 934 | else nil | |
856 | 935 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
857 | 936 | } | |
858 | 937 | ||
859 | 938 | ||
860 | 939 | ||
861 | 940 | @Callable(i) | |
862 | 941 | func capitalizeExPazzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
863 | - | let $ | |
942 | + | let $t03106931263 = if (claim) | |
864 | 943 | then claimFarmed(type, pool) | |
865 | 944 | else { | |
866 | 945 | let claimedAsset = if ((type == SF_POOL)) | |
867 | 946 | then SWOPID | |
868 | 947 | else WXID | |
869 | 948 | $Tuple2(amountToExchange, claimedAsset) | |
870 | 949 | } | |
871 | - | let claimedAmount = $ | |
872 | - | let claimedAsset = $ | |
950 | + | let claimedAmount = $t03106931263._1 | |
951 | + | let claimedAsset = $t03106931263._2 | |
873 | 952 | let exchangedAmount = exchangePazzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
874 | 953 | let change = (claimedAmount - amountToExchange) | |
875 | 954 | let changeEntry = if ((change > 0)) | |
876 | 955 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
877 | 956 | else nil | |
878 | 957 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
879 | 958 | } | |
880 | 959 | ||
881 | 960 | ||
882 | 961 | ||
883 | 962 | @Callable(i) | |
884 | 963 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
885 | - | let $ | |
964 | + | let $t03198632180 = if (claim) | |
886 | 965 | then claimFarmed(type, pool) | |
887 | 966 | else { | |
888 | 967 | let claimedAsset = if ((type == SF_POOL)) | |
889 | 968 | then SWOPID | |
890 | 969 | else WXID | |
891 | 970 | $Tuple2(amountToExchange, claimedAsset) | |
892 | 971 | } | |
893 | - | let claimedAmount = $ | |
894 | - | let claimedAsset = $ | |
972 | + | let claimedAmount = $t03198632180._1 | |
973 | + | let claimedAsset = $t03198632180._2 | |
895 | 974 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
896 | 975 | let change = (claimedAmount - amountToExchange) | |
897 | 976 | let changeEntry = if ((change > 0)) | |
898 | 977 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
899 | 978 | else nil | |
900 | 979 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
901 | 980 | } | |
902 | 981 | ||
903 | 982 | ||
904 | 983 | ||
905 | 984 | @Callable(i) | |
906 | - | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan, | |
985 | + | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan) = if (if ((type != SF_POOL)) | |
907 | 986 | then (type != WX_POOL) | |
908 | 987 | else false) | |
909 | 988 | then throw("Wrong type") | |
910 | - | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), IntegerEntry((poolAddr + kPoolInterest), 0), StringEntry((kPool + poolAddr), type)] | |
989 | + | else { | |
990 | + | let $t03282532919 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
991 | + | let aId = $t03282532919._1 | |
992 | + | let bId = $t03282532919._2 | |
993 | + | let aBal = $t03282532919._3 | |
994 | + | let bBal = $t03282532919._4 | |
995 | + | let shareId = $t03282532919._5 | |
996 | + | [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kPoolInterest), 0), StringEntry((kPool + poolAddr), type), StringEntry((shareId + kSharePool), poolAddr)] | |
997 | + | } | |
911 | 998 | ||
912 | 999 | ||
913 | 1000 | @Verifier(tx) | |
914 | 1001 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
915 | 1002 |
github/deemru/w8io/026f985 133.82 ms ◑