tx · 4kDj884iCvd4ktETz2jmJpahH5QGtZSiNvwzrQYLCXaY

3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS:  -0.04300000 Waves

2023.07.18 16:49 [2671396] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves

{ "type": 13, "id": "4kDj884iCvd4ktETz2jmJpahH5QGtZSiNvwzrQYLCXaY", "fee": 4300000, "feeAssetId": null, "timestamp": 1689687597695, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "5cMWgdSMPwgmdHfKf8pCG3YwQcgr6EyHyE9eSUq4VPSx5CXsNdSnABAnyjS9LkBbScyTc29UYp3E1STKHh6vcRWg" ], "script": "base64:BgKMAQgCEgMKAQgSBAoCCAgSBQoDCBgYEgUKAwgBCBIECgIIARIGCgQBCAgBEgUKAwEICBILCgkICAgICAgICAgSAwoBCBIDCgEIEgUKAwgIARIGCgQIAQgIEg0KCwgIAQQRGBgRAQEYEgkKBwgIAQQIARgSDQoLCAgBBBgYGBgYARgSCwoJCAgBAQEBAQEEbwAHU0ZfUE9PTAICU0YAB1dYX1BPT0wCAldYAA9DQVBfRkVFX05PX0xPQU4CCWNhcE5vTG9hbgAMQ0FQX0ZFRV9MT0FOAgdjYXBMb2FuABRTVE9QTE9TU19GRUVfTk9fTE9BTgIOc3RvcExvc3NOb0xvYW4ADVNUT1BMT1NTX0xPQU4CDHN0b3BMb3NzTG9hbgAITE9BTl9GRUUCBGxvYW4AC05PX0xPQU5fRkVFAgZub0xvYW4ABk5PX0ZFRQIFbm9GZWUABlNDQUxFOACAwtcvAAdTQ0FMRTEwAIDIr6AlAAdTQ0FMRTE2CQC2AgEAgICE/qbe4REACkZFRV9TQ0FMRTYAwIQ9ABRrU0ZQb29sQUFzc2V0QmFsYW5jZQIPQV9hc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3NGZWVXaXRoTG9hbgkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQhwb29sQWRkcgURa1Bvb2xJbnRlcmVzdExvYW4AAAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQhwb29sQWRkcgUTa1Bvb2xJbnRlcmVzdE5vTG9hbgAACQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUFa1Bvb2wFCHBvb2xBZGRyBQR0eXBlCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUHc2hhcmVJZAUKa1NoYXJlUG9vbAUIcG9vbEFkZHIJAMwIAgkBDEJvb2xlYW5FbnRyeQIJAKwCAgUIcG9vbEFkZHIFDmtQb29sQ2FuQm9ycm93BQljYW5Cb3Jyb3cFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmbOjvc", "height": 2671396, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4bMJ1pGGg6VNhmSb5F74VxHTeVTT8WcKGE7h5qPyovJP Next: GE8Q5syFYAaH7jxsXH1nNjEXFaFLCaZwEFRzJUEiB4U5 Diff:
OldNewDifferences
4141
4242 let kSFPoolFee = "commission"
4343
44-let kUserPosition = "_user_position"
44+let kUserPosition = "_userPosition"
4545
46-let kUserPositionPool = "_user_position_pool"
46+let kUserPositionPool = "_userPositionPool"
4747
48-let kUserBorrowAmount = "_user_position_borrow_amount"
48+let kUserBorrowAmount = "_userPositionBorrowAmount"
4949
50-let kUserBorrowAssetId = "_user_position_borrow_asset_id"
50+let kUserBorrowAssetId = "_userPositionBorrowAssetId"
5151
52-let kUserPositionNum = "_user_position_number"
52+let kUserPositionNum = "_userPositionNumber"
5353
54-let kUserPositionInterest = "_user_position_interest"
54+let kUserPositionInterest = "_userPositionInterest"
5555
56-let kPoolTotal = "_pool_total"
56+let kPoolTotal = "_poolTotal"
5757
58-let kPoolTotalLoan = "_pool_total_loan"
58+let kPoolTotalLoan = "_poolTotalLoan"
5959
60-let kPoolInterestLoan = "_pool_interest_loan"
60+let kPoolInterestLoan = "_poolInterestLoan"
6161
62-let kPoolInterestNoLoan = "_pool_interest_no_loan"
62+let kPoolInterestNoLoan = "_poolInterestNoLoan"
6363
64-let kPoolCanBorrow = "_pool_can_borrow"
64+let kPoolCanBorrow = "_poolCanBorrow"
6565
66-let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan"
66+let kAxlyInFeeWithoutLoan = "_axlyFeeNoLoan"
6767
68-let kAxlyInFeeWithLoan = "_axly_fee_with_loan"
68+let kAxlyInFeeWithLoan = "_axlyFeeWithLoan"
6969
70-let kAxlyNoLoanCapFee = "_axly_fee_cap_with_loan"
70+let kAxlyNoLoanCapFee = "_axlyFeeCapWithLoan"
7171
72-let kAxlyWithLoanCapFee = "_axly_fee_cap_no_loan"
72+let kAxlyWithLoanCapFee = "_axlyFeeCapNoLoan"
7373
74-let kAxlyStopLossNoLoanFee = "_axly_fee_stoploss_with_loan"
74+let kAxlyStopLossNoLoanFee = "_axlyFeeStoplossWithLoan"
7575
76-let kAxlyStopLossLoanFee = "_axly_fee_stoploss_no_loan"
76+let kAxlyStopLossLoanFee = "_axlyFeeStoplossNoLoan"
7777
7878 let kRequestId = "_request_id"
7979
8181
8282 let kPool = "pool_"
8383
84-let kSharePool = "_pool_share_id"
84+let kSharePool = "_poolShareId"
8585
86-let kPoolCapChange = "_pool_cap_change"
86+let kPoolCapChange = "_poolCapChange"
8787
8888 let kTokenLastPrice = "last_price"
8989
9090 let kPriceInOracle = "_twap5B"
9191
92-let kUserStopLoss = "_stop_loss"
92+let kUserStopLoss = "_stopLoss"
9393
9494 let kMoneyBox = "axly_money_box"
9595
120120 let SWOPID = fromBase58String(valueOrErrorMessage(getString(this, kSwopId), "No swop id"))
121121
122122 let WXID = fromBase58String(valueOrErrorMessage(getString(this, kWxId), "No wx id"))
123+
124+func unknownPoolType () = throw("Wrong pool type")
125+
123126
124127 func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr")))
125128
172175 then getSFPoolBalances(poolAddr)
173176 else if ((type == WX_POOL))
174177 then getWXPoolBalances(poolAddr, aId, bId)
175- else throw("Wrong pool type")
178+ else unknownPoolType()
176179
177180
178181 func getSFPoolData (poolAddr) = {
179- let $t061916240 = getSFPoolBalances(poolAddr)
180- if (($t061916240 == $t061916240))
182+ let $t061796228 = getSFPoolBalances(poolAddr)
183+ if (($t061796228 == $t061796228))
181184 then {
182- let balB = $t061916240._2
183- let balA = $t061916240._1
185+ let balB = $t061796228._2
186+ let balA = $t061796228._1
184187 $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), balA, balB, valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id"))
185188 }
186189 else throw("Strict value is not equal to itself.")
214217 then @
215218 else unit
216219 }, "Can't get pool LP asset id")
217- let $t069376996 = getWXPoolBalances(poolAddr, aId, bId)
218- if (($t069376996 == $t069376996))
220+ let $t069256984 = getWXPoolBalances(poolAddr, aId, bId)
221+ if (($t069256984 == $t069256984))
219222 then {
220- let balB = $t069376996._2
221- let balA = $t069376996._1
223+ let balB = $t069256984._2
224+ let balA = $t069256984._1
222225 $Tuple5(aId, bId, balA, balB, shareId)
223226 }
224227 else throw("Strict value is not equal to itself.")
231234 then getSFPoolData(poolAddr)
232235 else if ((type == WX_POOL))
233236 then getWXPoolData(poolAddr)
234- else throw("Wrong pool type")
237+ else unknownPoolType()
235238
236239
237240 func getShareSupply (poolAddr,type,shareId) = if ((type == SF_POOL))
238241 then valueOrErrorMessage(getInteger(poolAddr, kSFPoolShareSupply), "Can't get share asset supply")
239242 else if ((type == WX_POOL))
240243 then valueOrErrorMessage(assetInfo(fromBase58String(shareId)), "Wrong ShareId").quantity
241- else throw("Wrong pool type")
244+ else unknownPoolType()
242245
243246
244247 func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0)
326329 let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id")
327330 let poolAddr = Address(fromBase58String(pool))
328331 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
329- let $t0998810053 = getPoolData(poolAddr, pType)
330- let aId = $t0998810053._1
331- let bId = $t0998810053._2
332- let aBalance = $t0998810053._3
333- let bBalance = $t0998810053._4
332+ let $t0996210027 = getPoolData(poolAddr, pType)
333+ let aId = $t0996210027._1
334+ let bId = $t0996210027._2
335+ let aBalance = $t0996210027._3
336+ let bBalance = $t0996210027._4
334337 let dPriceA = getIntegerValue(priceOracleAddr, (aId + kPriceInOracle))
335338 let dPriceB = getIntegerValue(priceOracleAddr, (bId + kPriceInOracle))
336339 let shareSupply = getShareSupply(poolAddr, pType, shareId)
400403 })
401404 else throw("Strict value is not equal to itself.")
402405 }
403- else {
404- let $t01157311823 = $Tuple2(split({
405- let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil)
406- if ($isInstanceOf(@, "String"))
407- then @
408- else throw(($getType(@) + " couldn't be cast to String"))
409- }, "__"), split({
410- let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil)
411- if ($isInstanceOf(@, "String"))
412- then @
413- else throw(($getType(@) + " couldn't be cast to String"))
414- }, "__"))
415- if (($t01157311823 == $t01157311823))
416- then {
417- let evalPutInB = $t01157311823._2
418- let evalPutInA = $t01157311823._1
419- let lpInA = parseIntValue(evalPutInA[1])
420- let lpInB = parseIntValue(evalPutInB[1])
421- if ((lpInB > lpInA))
422- then {
423- let pmt = parseIntValue(evalPutInA[8])
424- $Tuple5(pmtA, pmt, (pmtB - pmt), bId, lpInB)
425- }
426- else {
427- let pmt = parseIntValue(evalPutInB[7])
428- $Tuple5(pmt, pmtB, (pmtA - pmt), aId, lpInA)
429- }
430- }
431- else throw("Strict value is not equal to itself.")
432- }
406+ else if ((pType == WX_POOL))
407+ then {
408+ let $t01157211822 = $Tuple2(split({
409+ let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil)
410+ if ($isInstanceOf(@, "String"))
411+ then @
412+ else throw(($getType(@) + " couldn't be cast to String"))
413+ }, "__"), split({
414+ let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil)
415+ if ($isInstanceOf(@, "String"))
416+ then @
417+ else throw(($getType(@) + " couldn't be cast to String"))
418+ }, "__"))
419+ if (($t01157211822 == $t01157211822))
420+ then {
421+ let evalPutInB = $t01157211822._2
422+ let evalPutInA = $t01157211822._1
423+ let lpInA = parseIntValue(evalPutInA[1])
424+ let lpInB = parseIntValue(evalPutInB[1])
425+ if ((lpInB > lpInA))
426+ then {
427+ let pmt = parseIntValue(evalPutInA[8])
428+ $Tuple5(pmtA, pmt, (pmtB - pmt), bId, lpInB)
429+ }
430+ else {
431+ let pmt = parseIntValue(evalPutInB[7])
432+ $Tuple5(pmt, pmtB, (pmtA - pmt), aId, lpInA)
433+ }
434+ }
435+ else throw("Strict value is not equal to itself.")
436+ }
437+ else unknownPoolType()
433438
434439
435440 func replenishTwoTokensByType (poolAddr,pType,pmtA,aId,pmtB,bId) = {
436441 let payments = [AttachedPayment(assetIdFromStr(aId), pmtA), AttachedPayment(assetIdFromStr(bId), pmtB)]
437442 if ((pType == SF_POOL))
438443 then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments)
439- else invoke(poolAddr, "put", [1000000, false], payments)
444+ else if ((pType == WX_POOL))
445+ then invoke(poolAddr, "put", [1000000, false], payments)
446+ else unknownPoolType()
440447 }
441448
442449
444451 let payments = [AttachedPayment(assetIdFromStr(pmtId), pmt)]
445452 if ((pType == SF_POOL))
446453 then invoke(poolAddr, "callFunction", ["replenishWithOneToken", ["0", "false", "0"]], payments)
447- else invoke(poolAddr, "putOneTkn", [0, false], payments)
454+ else if ((pType == WX_POOL))
455+ then invoke(poolAddr, "putOneTkn", [0, false], payments)
456+ else unknownPoolType()
448457 }
449458
450459
452461 let payments = [AttachedPayment(fromBase58String(shareId), amount)]
453462 if ((pType == SF_POOL))
454463 then invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], payments)
455- else invoke(getWXFarmingAddr(addressFromStringValue(pool)), "stake", nil, payments)
464+ else if ((pType == WX_POOL))
465+ then invoke(getWXFarmingAddr(addressFromStringValue(pool)), "stake", nil, payments)
466+ else unknownPoolType()
456467 }
457468
458469
459470 func unstakeLP (pool,pType,shareId,amount) = {
460- let $t01330813665 = if ((pType == SF_POOL))
471+ let $t01348113831 = if ((pType == SF_POOL))
461472 then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount])
462473 else if ((pType == WX_POOL))
463474 then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount])
464- else throw("Wrong pool type")
465- let farmAddr = $t01330813665._1
466- let fName = $t01330813665._2
467- let params = $t01330813665._3
475+ else unknownPoolType()
476+ let farmAddr = $t01348113831._1
477+ let fName = $t01348113831._2
478+ let params = $t01348113831._3
468479 let inv = invoke(farmAddr, fName, params, nil)
469480 if ((inv == inv))
470481 then amount
477488 let feeScale6 = 1000000
478489 let fee = getIntegerValue(poolAddr, kSFPoolFee)
479490 let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee), CEILING)
480- let $t01408714393 = if ((assetTokenToGet == assetIdA))
491+ let $t01425314559 = if ((assetTokenToGet == assetIdA))
481492 then {
482493 let amountToPay = fraction(amntGetNoFee, balB, (balA - amntGetNoFee), CEILING)
483494 $Tuple2(amountToPay, assetIdB)
486497 let amountToPay = fraction(amntGetNoFee, balA, (balB - amntGetNoFee), CEILING)
487498 $Tuple2(amountToPay, assetIdA)
488499 }
489- let amountToPay = $t01408714393._1
490- let assetToPay = $t01408714393._2
500+ let amountToPay = $t01425314559._1
501+ let assetToPay = $t01425314559._2
491502 $Tuple2(assetToPay, amountToPay)
492503 }
493504
496507 let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee")
497508 let pFee = getIntegerValue(wxSwapContract, "%s__poolFee")
498509 let feeScale = toBigInt(100000000)
499- let $t01473215040 = if ((assetTokenToGet == assetIdA))
510+ let $t01489815206 = if ((assetTokenToGet == assetIdA))
500511 then {
501512 let amountToPay = fraction(amountTokenToGet, balB, (balA - amountTokenToGet))
502513 $Tuple2(amountToPay, assetIdB)
505516 let amountToPay = fraction(amountTokenToGet, balA, (balB - amountTokenToGet))
506517 $Tuple2(amountToPay, assetIdA)
507518 }
508- let amountToPay = $t01473215040._1
509- let assetToPay = $t01473215040._2
519+ let amountToPay = $t01489815206._1
520+ let assetToPay = $t01489815206._2
510521 let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))), CEILING))
511522 $Tuple2(assetToPay, amountToPayWithFee)
512523 }
513524
514525
515-func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL))
526+func exchangeDirectly (pType,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((pType == SF_POOL))
516527 then {
517- let $t01538515507 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
518- let assetToPay = $t01538515507._1
519- let amountToPay = $t01538515507._2
528+ let $t01555315675 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
529+ let assetToPay = $t01555315675._1
530+ let amountToPay = $t01555315675._2
520531 invoke(addressFromStringValue(pool), "callFunction", ["exchange", [toString(amountTokenToGet)]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)])
521532 }
522- else {
523- let $t01568215804 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
524- let assetToPay = $t01568215804._1
525- let amountToPay = $t01568215804._2
526- invoke(wxSwapContract, "swap", [amountTokenToGet, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)])
527- }
533+ else if ((pType == WX_POOL))
534+ then {
535+ let $t01587515997 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
536+ let assetToPay = $t01587515997._1
537+ let amountToPay = $t01587515997._2
538+ invoke(wxSwapContract, "swap", [amountTokenToGet, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)])
539+ }
540+ else unknownPoolType()
528541
529542
530543 func calcWithdrawLPFromPoolVirt (poolAddr,pType,shareId,userCanWithdraw) = {
531- let $t01606616453 = if ((pType == SF_POOL))
544+ let $t01628416723 = if ((pType == SF_POOL))
532545 then {
533546 let inv = {
534547 let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(userCanWithdraw)]], nil)
540553 then $Tuple2(inv._1, inv._2)
541554 else throw("Strict value is not equal to itself.")
542555 }
543- else {
544- let inv = split({
545- let @ = invoke(poolAddr, "evaluateGetREADONLY", [shareId, userCanWithdraw], nil)
546- if ($isInstanceOf(@, "String"))
547- then @
548- else throw(($getType(@) + " couldn't be cast to String"))
549- }, "__")
550- if ((inv == inv))
551- then $Tuple2(parseIntValue(inv[1]), parseIntValue(inv[2]))
552- else throw("Strict value is not equal to itself.")
553- }
554- let amountA = $t01606616453._1
555- let amountB = $t01606616453._2
556+ else if ((pType == WX_POOL))
557+ then {
558+ let inv = split({
559+ let @ = invoke(poolAddr, "evaluateGetREADONLY", [shareId, userCanWithdraw], nil)
560+ if ($isInstanceOf(@, "String"))
561+ then @
562+ else throw(($getType(@) + " couldn't be cast to String"))
563+ }, "__")
564+ if ((inv == inv))
565+ then $Tuple2(parseIntValue(inv[1]), parseIntValue(inv[2]))
566+ else throw("Strict value is not equal to itself.")
567+ }
568+ else unknownPoolType()
569+ let amountA = $t01628416723._1
570+ let amountB = $t01628416723._2
556571 $Tuple2(amountA, amountB)
557572 }
558573
559574
560-func claimFarmed (type,pool) = if ((type == SF_POOL))
575+func claimFarmed (pType,pool) = if ((pType == SF_POOL))
561576 then {
562577 let balBefore = accountBalance(SWOPID)
563578 if ((balBefore == balBefore))
572587 }
573588 else throw("Strict value is not equal to itself.")
574589 }
575- else if ((type == WX_POOL))
590+ else if ((pType == WX_POOL))
576591 then {
577592 let balBefore = accountBalance(WXID)
578593 if ((balBefore == balBefore))
587602 }
588603 else throw("Strict value is not equal to itself.")
589604 }
590- else throw("Wrong pool type")
605+ else unknownPoolType()
591606
592607
593608 func replenishByType (pType,pool,feeType,pmtA,aId,pmtB,bId,balA,balB,LPId) = {
595610 if ((lpBalanceBefore == lpBalanceBefore))
596611 then {
597612 let poolAddr = addressFromStringValue(pool)
598- let $t01743917855 = if (if ((pmtA > 0))
613+ let $t01768818104 = if (if ((pmtA > 0))
599614 then (pmtB > 0)
600615 else false)
601616 then {
602- let $t01750517621 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
603- let pmtInA = $t01750517621._1
604- let pmtInB = $t01750517621._2
605- let change = $t01750517621._3
606- let changeId = $t01750517621._4
617+ let $t01775417870 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
618+ let pmtInA = $t01775417870._1
619+ let pmtInB = $t01775417870._2
620+ let change = $t01775417870._3
621+ let changeId = $t01775417870._4
607622 let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId)
608623 if ((inv == inv))
609624 then $Tuple2(change, changeId)
614629 else if ((pmtB > 0))
615630 then $Tuple2(pmtB, bId)
616631 else throw("pmts must be > 0")
617- let change = $t01743917855._1
618- let changeId = $t01743917855._2
632+ let change = $t01768818104._1
633+ let changeId = $t01768818104._2
619634 let inv = if ((change > 0))
620635 then replenishOneTokenByType(poolAddr, pType, change, changeId)
621636 else nil
643658 func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = {
644659 let totalAmount = getPoolTotalShare(pool)
645660 let totalAmountLoan = getPoolTotalShareWithLoan(pool)
646- let $t01871318951 = if (withLoan)
661+ let $t01896219200 = if (withLoan)
647662 then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount))
648663 else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan)
649- let curPoolInterest = $t01871318951._1
650- let totalStakedWithLoan = $t01871318951._2
664+ let curPoolInterest = $t01896219200._1
665+ let totalStakedWithLoan = $t01896219200._2
651666 [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), totalStakedWithLoan), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), StringEntry((((user + "_") + toString(posNum)) + kUserPositionPool), pool), IntegerEntry((user + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))]
652667 }
653668
693708
694709 func capitalize (pool,pType,tokenId,tokenAmount) = {
695710 let poolAddr = Address(fromBase58String(pool))
696- let $t02130221368 = getPoolData(poolAddr, pType)
697- let AId = $t02130221368._1
698- let BId = $t02130221368._2
699- let balA = $t02130221368._3
700- let balB = $t02130221368._4
701- let shareId = $t02130221368._5
711+ let $t02155121617 = getPoolData(poolAddr, pType)
712+ let AId = $t02155121617._1
713+ let BId = $t02155121617._2
714+ let balA = $t02155121617._3
715+ let balB = $t02155121617._4
716+ let shareId = $t02155121617._5
702717 if (if ((tokenId != AId))
703718 then (tokenId != BId)
704719 else false)
705720 then throw("Wrong asset")
706721 else {
707- let $t02145321533 = if ((tokenId == AId))
722+ let $t02170221782 = if ((tokenId == AId))
708723 then $Tuple2(tokenAmount, 0)
709724 else $Tuple2(0, tokenAmount)
710- let pmtA = $t02145321533._1
711- let pmtB = $t02145321533._2
712- let $t02153621640 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
713- let stakedAmount = $t02153621640._1
714- let nf = $t02153621640._2
725+ let pmtA = $t02170221782._1
726+ let pmtB = $t02170221782._2
727+ let $t02178521889 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
728+ let stakedAmount = $t02178521889._1
729+ let nf = $t02178521889._2
715730 let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0)
716731 let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0)
717732 let totalShareAmount = getPoolTotalShare(pool)
735750 }
736751
737752
738-func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = {
753+func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset,stopLossFee) = {
739754 let poolAddr = Address(fromBase58String(pool))
740755 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool")
741- let $t02341223488 = getPoolData(poolAddr, pType)
742- let assetIdA = $t02341223488._1
743- let assetIdB = $t02341223488._2
744- let balA = $t02341223488._3
745- let balB = $t02341223488._4
746- let shareId = $t02341223488._5
756+ let $t02367923755 = getPoolData(poolAddr, pType)
757+ let assetIdA = $t02367923755._1
758+ let assetIdB = $t02367923755._2
759+ let balA = $t02367923755._3
760+ let balB = $t02367923755._4
761+ let shareId = $t02367923755._5
747762 let cBalABefore = accountBalance(assetIdFromStr(assetIdA))
748763 if ((cBalABefore == cBalABefore))
749764 then {
751766 if ((cBalBBefore == cBalBBefore))
752767 then {
753768 let inv = if ((pType == SF_POOL))
754- then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil)
755- else {
756- let inv = unstakeLP(pool, pType, shareId, userCanWithdraw)
769+ then {
770+ let inv = unstakeLP(pool, pType, shareId, stopLossFee)
757771 if ((inv == inv))
758- then invoke(poolAddr, "get", nil, [AttachedPayment(assetIdFromStr(shareId), userCanWithdraw)])
772+ then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil)
759773 else throw("Strict value is not equal to itself.")
760774 }
775+ else if ((pType == WX_POOL))
776+ then {
777+ let inv = unstakeLP(pool, pType, shareId, (userCanWithdraw + stopLossFee))
778+ if ((inv == inv))
779+ then invoke(poolAddr, "get", nil, [AttachedPayment(assetIdFromStr(shareId), userCanWithdraw)])
780+ else throw("Strict value is not equal to itself.")
781+ }
782+ else unknownPoolType()
761783 if ((inv == inv))
762784 then {
763785 let cBalAAfter = accountBalance(assetIdFromStr(assetIdA))
764786 let cBalBAfter = accountBalance(assetIdFromStr(assetIdB))
765- let $t02405124140 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore))
766- let tokensAmountA = $t02405124140._1
767- let tokensAmountB = $t02405124140._2
768- let $t02414324997 = if ((debt > 0))
787+ let $t02444824537 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore))
788+ let tokensAmountA = $t02444824537._1
789+ let tokensAmountB = $t02444824537._2
790+ let $t02454025394 = if ((debt > 0))
769791 then {
770792 let amountToGetEx = if (if ((borrowAsset == assetIdA))
771793 then (debt > tokensAmountA)
790812 else throw("Strict value is not equal to itself.")
791813 }
792814 else $Tuple2(tokensAmountA, tokensAmountB)
793- let toUserA = $t02414324997._1
794- let toUserB = $t02414324997._2
815+ let toUserA = $t02454025394._1
816+ let toUserB = $t02454025394._2
795817 $Tuple7(toUserA, assetIdA, toUserB, assetIdB, cBalAAfter, cBalBAfter, shareId)
796818 }
797819 else throw("Strict value is not equal to itself.")
819841 let poolTotalShare = getPoolTotalShare(pool)
820842 let userAddr = Address(fromBase58String(user))
821843 let borrowAsset = valueOrElse(getString(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)), "")
822- let debt = if ((borrowAmount > 0))
823- then {
844+ let $t02661626850 = if ((borrowAmount > 0))
845+ then $Tuple2({
824846 let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posId), borrowAsset], nil)
825847 if ($isInstanceOf(@, "Int"))
826848 then @
827849 else throw(($getType(@) + " couldn't be cast to Int"))
828- }
850+ }, STOPLOSS_LOAN)
851+ else $Tuple2(0, STOPLOSS_FEE_NO_LOAN)
852+ let debt = $t02661626850._1
853+ let feeType = $t02661626850._2
854+ let stopLossFee = if (stopLoss)
855+ then fraction(userCanWithdraw, getAxlyFee(pool, feeType), FEE_SCALE6)
829856 else 0
830- let $t02638526538 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset)
831- if (($t02638526538 == $t02638526538))
857+ let $t02696727147 = withdrawAmountCalc(pool, (userCanWithdraw - stopLossFee), debt, borrowAsset, stopLossFee)
858+ if (($t02696727147 == $t02696727147))
832859 then {
833- let shareId = $t02638526538._7
834- let cBalBAfter = $t02638526538._6
835- let cBalAAfter = $t02638526538._5
836- let assetIdB = $t02638526538._4
837- let toUserAmountB = $t02638526538._3
838- let assetIdA = $t02638526538._2
839- let toUserAmountA = $t02638526538._1
860+ let shareId = $t02696727147._7
861+ let cBalBAfter = $t02696727147._6
862+ let cBalAAfter = $t02696727147._5
863+ let assetIdB = $t02696727147._4
864+ let toUserAmountB = $t02696727147._3
865+ let assetIdA = $t02696727147._2
866+ let toUserAmountA = $t02696727147._1
840867 let closeDbtInv = if ((debt > 0))
841868 then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)])
842869 else 0
843870 if ((closeDbtInv == closeDbtInv))
844- then ([DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, toUserAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, toUserAmountB, assetIdFromStr(assetIdB))] ++ getCursEntries(assetIdA, assetIdB, shareId, nil))
871+ then ([DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), ((poolTotalShare - userCanWithdraw) - stopLossFee)), ScriptTransfer(userAddr, toUserAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, toUserAmountB, assetIdFromStr(assetIdB)), ScriptTransfer(moneyBox, stopLossFee, fromBase58String(shareId))] ++ getCursEntries(assetIdA, assetIdB, shareId, nil))
845872 else throw("Strict value is not equal to itself.")
846873 }
847874 else throw("Strict value is not equal to itself.")
871898 let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN)
872899 let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN)
873900 let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB))
874- let $t02818228279 = if ((borrowId == aId))
901+ let $t02887628973 = if ((borrowId == aId))
875902 then $Tuple2(dPriceA, decPrA)
876903 else $Tuple2(dPriceB, decPrB)
877- let borrowPrice = $t02818228279._1
878- let borrowDecPr = $t02818228279._2
904+ let borrowPrice = $t02887628973._1
905+ let borrowDecPr = $t02887628973._2
879906 fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice)
880907 }
881908
924951 @Callable(i)
925952 func getUserPositionInDollarsREADONLY (user,pools,posNum) = {
926953 func userPos (a,pool) = {
927- let $t02997830012 = a
928- let totalPos = $t02997830012._1
929- let posDebt = $t02997830012._2
930- let index = $t02997830012._3
954+ let $t03067230706 = a
955+ let totalPos = $t03067230706._1
956+ let posDebt = $t03067230706._2
957+ let index = $t03067230706._3
931958 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
932- let $t03010430194 = getPoolData(Address(fromBase58String(pool)), pType)
933- let AId = $t03010430194._1
934- let BId = $t03010430194._2
935- let balA = $t03010430194._3
936- let balB = $t03010430194._4
937- let shareId = $t03010430194._5
959+ let $t03079830888 = getPoolData(Address(fromBase58String(pool)), pType)
960+ let AId = $t03079830888._1
961+ let BId = $t03079830888._2
962+ let balA = $t03079830888._3
963+ let balB = $t03079830888._4
964+ let shareId = $t03079830888._5
938965 let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0)
939966 let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0))
940967 let sharePrices = getSharePrice(shareId)
957984 }
958985 }
959986
960- let $t03121431269 = {
987+ let $t03190831963 = {
961988 let $l = pools
962989 let $s = size($l)
963990 let $acc0 = $Tuple3(nil, nil, 0)
971998
972999 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
9731000 }
974- let pos = $t03121431269._1
975- let debt = $t03121431269._2
1001+ let pos = $t03190831963._1
1002+ let debt = $t03190831963._2
9761003 $Tuple2(nil, $Tuple2(pos, debt))
9771004 }
9781005
9891016 then throw("You can't borrow in this pool")
9901017 else {
9911018 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
992- let $t03170931799 = getPoolData(Address(fromBase58String(pool)), pType)
993- let AId = $t03170931799._1
994- let BId = $t03170931799._2
995- let balA = $t03170931799._3
996- let balB = $t03170931799._4
997- let shareId = $t03170931799._5
998- let $t03180231883 = parseReplenishPmts(i.payments, AId, BId)
999- let pmtA = $t03180231883._1
1000- let pmtAssetA = $t03180231883._2
1001- let pmtB = $t03180231883._3
1002- let pmtAssetB = $t03180231883._4
1019+ let $t03240332493 = getPoolData(Address(fromBase58String(pool)), pType)
1020+ let AId = $t03240332493._1
1021+ let BId = $t03240332493._2
1022+ let balA = $t03240332493._3
1023+ let balB = $t03240332493._4
1024+ let shareId = $t03240332493._5
1025+ let $t03249632577 = parseReplenishPmts(i.payments, AId, BId)
1026+ let pmtA = $t03249632577._1
1027+ let pmtAssetA = $t03249632577._2
1028+ let pmtB = $t03249632577._3
1029+ let pmtAssetB = $t03249632577._4
10031030 let user = toString(i.caller)
10041031 let newPosNum = getNewUserPositionNumber(user)
10051032 if ((leverage > 100))
10191046 if ((inv == inv))
10201047 then {
10211048 let userStaked = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPosition))
1022- let $t03289632990 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId)
1023- if (($t03289632990 == $t03289632990))
1049+ let $t03359033684 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId)
1050+ if (($t03359033684 == $t03359033684))
10241051 then {
1025- let newBalB = $t03289632990._2
1026- let newBalA = $t03289632990._1
1052+ let newBalB = $t03359033684._2
1053+ let newBalA = $t03359033684._1
10271054 let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB)
1028- let $t03306033175 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1029- let wAmountA = $t03306033175._1
1030- let wAmountB = $t03306033175._2
1055+ let $t03375433869 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1056+ let wAmountA = $t03375433869._1
1057+ let wAmountB = $t03375433869._2
10311058 $Tuple2(nil, [prImpact, wAmountA, wAmountB])
10321059 }
10331060 else throw("Strict value is not equal to itself.")
10371064 else throw("Strict value is not equal to itself.")
10381065 }
10391066 else {
1040- let $t03322833340 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1041- let userStaked = $t03322833340._1
1042- let axlyFee = $t03322833340._2
1043- let $t03334633440 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId)
1044- if (($t03334633440 == $t03334633440))
1067+ let $t03392234034 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1068+ let userStaked = $t03392234034._1
1069+ let axlyFee = $t03392234034._2
1070+ let $t03404034134 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId)
1071+ if (($t03404034134 == $t03404034134))
10451072 then {
1046- let newBalB = $t03334633440._2
1047- let newBalA = $t03334633440._1
1073+ let newBalB = $t03404034134._2
1074+ let newBalA = $t03404034134._1
10481075 let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB)
1049- let $t03351033625 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1050- let wAmountA = $t03351033625._1
1051- let wAmountB = $t03351033625._2
1076+ let $t03420434319 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1077+ let wAmountA = $t03420434319._1
1078+ let wAmountB = $t03420434319._2
10521079 $Tuple2((replenishEntries(pool, user, userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])), [prImpact, wAmountA, wAmountB])
10531080 }
10541081 else throw("Strict value is not equal to itself.")
11001127
11011128 @Callable(i)
11021129 func replenishFromLand (requestId) = valueOrElse(isLandCall(i), {
1103- let $t03615136255 = parseRequest(requestId)
1104- let user = $t03615136255._1
1105- let pool = $t03615136255._2
1106- let pmtA = $t03615136255._3
1107- let AId = $t03615136255._4
1108- let pmtB = $t03615136255._5
1109- let BId = $t03615136255._6
1110- let balA = $t03615136255._7
1111- let balB = $t03615136255._8
1112- let shareId = $t03615136255._9
1113- let bwAsset = $t03615136255._10
1114- let bwAmount = $t03615136255._11
1130+ let $t03684536949 = parseRequest(requestId)
1131+ let user = $t03684536949._1
1132+ let pool = $t03684536949._2
1133+ let pmtA = $t03684536949._3
1134+ let AId = $t03684536949._4
1135+ let pmtB = $t03684536949._5
1136+ let BId = $t03684536949._6
1137+ let balA = $t03684536949._7
1138+ let balB = $t03684536949._8
1139+ let shareId = $t03684536949._9
1140+ let bwAsset = $t03684536949._10
1141+ let bwAmount = $t03684536949._11
11151142 if ((size(i.payments) != 1))
11161143 then throw("Wrong payment size")
11171144 else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset))
11191146 else (i.payments[0].amount != bwAmount))
11201147 then throw("Wrong payment")
11211148 else {
1122- let $t03644536569 = if ((AId == bwAsset))
1149+ let $t03713937263 = if ((AId == bwAsset))
11231150 then $Tuple2((pmtA + i.payments[0].amount), pmtB)
11241151 else $Tuple2(pmtA, (pmtB + i.payments[0].amount))
1125- let pmtAllA = $t03644536569._1
1126- let pmtAllB = $t03644536569._2
1152+ let pmtAllA = $t03713937263._1
1153+ let pmtAllB = $t03713937263._2
11271154 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool")
1128- let $t03665136766 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId)
1129- let userStaked = $t03665136766._1
1130- let axlyFee = $t03665136766._2
1155+ let $t03734537460 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId)
1156+ let userStaked = $t03734537460._1
1157+ let axlyFee = $t03734537460._2
11311158 let posNum = getNewUserPositionNumber(user)
11321159 let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)]
11331160 let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true)
1134- let $t03712637241 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1135- let wAmountA = $t03712637241._1
1136- let wAmountB = $t03712637241._2
1161+ let $t03782037935 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1162+ let wAmountA = $t03782037935._1
1163+ let wAmountB = $t03782037935._2
11371164 $Tuple2((((entries ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked)
11381165 }
11391166 })
11441171 func liquidate (user,posId,liquidateAmount) = valueOrElse(isLandCall(i), {
11451172 let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position")
11461173 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
1147- let $t03773637826 = getPoolData(Address(fromBase58String(pool)), pType)
1148- let AId = $t03773637826._1
1149- let BId = $t03773637826._2
1150- let balA = $t03773637826._3
1151- let balB = $t03773637826._4
1152- let shareId = $t03773637826._5
1174+ let $t03843038520 = getPoolData(Address(fromBase58String(pool)), pType)
1175+ let AId = $t03843038520._1
1176+ let BId = $t03843038520._2
1177+ let balA = $t03843038520._3
1178+ let balB = $t03843038520._4
1179+ let shareId = $t03843038520._5
11531180 let amount = unstakeLP(pool, pType, shareId, liquidateAmount)
11541181 let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount))
11551182 let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId))
11561183 let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0))
1157- if ((borrowAmount == 0))
1158- then throw("You can't liquidate position without borrow")
1159- else [IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest), getIntegerValue(this, (pool + kPoolInterestLoan))), IntegerEntry((pool + kPoolTotalLoan), (getPoolTotalShareWithLoan(pool) - liquidateAmount)), IntegerEntry((pool + kPoolTotal), (getPoolTotalShare(pool) - liquidateAmount)), IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition), (userCanWithdraw - liquidateAmount)), ScriptTransfer(i.caller, amount, fromBase58String(shareId))]
1184+ if ((liquidateAmount > userCanWithdraw))
1185+ then throw("You can't liquidate more than user have")
1186+ else if ((borrowAmount == 0))
1187+ then throw("You can't liquidate position without borrow")
1188+ else [IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest), getIntegerValue(this, (pool + kPoolInterestLoan))), IntegerEntry((pool + kPoolTotalLoan), (getPoolTotalShareWithLoan(pool) - liquidateAmount)), IntegerEntry((pool + kPoolTotal), (getPoolTotalShare(pool) - liquidateAmount)), IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition), (userCanWithdraw - liquidateAmount)), ScriptTransfer(i.caller, amount, fromBase58String(shareId))]
11601189 })
11611190
11621191
11641193 @Callable(i)
11651194 func stopLoss (user,posId,pool,assetId) = valueOrElse(isAdminCall(i), {
11661195 let tokenOraclePrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle))
1167- if (!(isDefined(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)))))
1168- then throw("No entry")
1169- else (withdrawToUser(toString(i.caller), pool, toString(posId), true) :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)))
1196+ if ((tokenOraclePrice > tokenOraclePrice))
1197+ then throw("Token price greater stop loss price")
1198+ else if (!(isDefined(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)))))
1199+ then throw("No entry")
1200+ else (withdrawToUser(user, pool, toString(posId), true) :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)))
11701201 })
11711202
11721203
11731204
11741205 @Callable(i)
11751206 func capitalizeExKeeper (pool,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = valueOrElse(isAdminCall(i), {
1176- let type = getStringValue(this, (kPool + pool))
1177- let $t03961939813 = if (claim)
1178- then claimFarmed(type, pool)
1207+ let pType = getStringValue(this, (kPool + pool))
1208+ let $t04049340784 = if (claim)
1209+ then claimFarmed(pType, pool)
11791210 else {
1180- let claimedAsset = if ((type == SF_POOL))
1211+ let claimedAsset = if ((pType == SF_POOL))
11811212 then SWOPID
1182- else WXID
1213+ else if ((pType == WX_POOL))
1214+ then WXID
1215+ else unknownPoolType()
11831216 $Tuple2(amountToExchange, claimedAsset)
11841217 }
1185- let claimedAmount = $t03961939813._1
1186- let claimedAsset = $t03961939813._2
1218+ let claimedAmount = $t04049340784._1
1219+ let claimedAsset = $t04049340784._2
11871220 let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options)
11881221 let change = (claimedAmount - amountToExchange)
11891222 let changeEntry = if ((change > 0))
11901223 then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))]
11911224 else nil
1192- (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry)
1225+ (capitalize(pool, pType, tokenToId, exchangedAmount) ++ changeEntry)
11931226 })
11941227
11951228
11961229
11971230 @Callable(i)
11981231 func capitalizeExPuzzle (pool,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = valueOrElse(isAdminCall(i), {
1199- let type = getStringValue(this, (kPool + pool))
1200- let $t04052840722 = if (claim)
1201- then claimFarmed(type, pool)
1232+ let pType = getStringValue(this, (kPool + pool))
1233+ let $t04150141792 = if (claim)
1234+ then claimFarmed(pType, pool)
12021235 else {
1203- let claimedAsset = if ((type == SF_POOL))
1236+ let claimedAsset = if ((pType == SF_POOL))
12041237 then SWOPID
1205- else WXID
1238+ else if ((pType == WX_POOL))
1239+ then WXID
1240+ else unknownPoolType()
12061241 $Tuple2(amountToExchange, claimedAsset)
12071242 }
1208- let claimedAmount = $t04052840722._1
1209- let claimedAsset = $t04052840722._2
1243+ let claimedAmount = $t04150141792._1
1244+ let claimedAsset = $t04150141792._2
12101245 let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options)
12111246 let change = (claimedAmount - amountToExchange)
12121247 let changeEntry = if ((change > 0))
12131248 then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))]
12141249 else nil
1215- (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry)
1250+ (capitalize(pool, pType, tokenToId, exchangedAmount) ++ changeEntry)
12161251 })
12171252
12181253
12191254
12201255 @Callable(i)
12211256 func capitalizeExSwopFi (pool,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = valueOrElse(isAdminCall(i), {
1222- let type = getStringValue(this, (kPool + pool))
1223- let $t04150441698 = if (claim)
1224- then claimFarmed(type, pool)
1257+ let pType = getStringValue(this, (kPool + pool))
1258+ let $t04257642867 = if (claim)
1259+ then claimFarmed(pType, pool)
12251260 else {
1226- let claimedAsset = if ((type == SF_POOL))
1261+ let claimedAsset = if ((pType == SF_POOL))
12271262 then SWOPID
1228- else WXID
1263+ else if ((pType == WX_POOL))
1264+ then WXID
1265+ else unknownPoolType()
12291266 $Tuple2(amountToExchange, claimedAsset)
12301267 }
1231- let claimedAmount = $t04150441698._1
1232- let claimedAsset = $t04150441698._2
1268+ let claimedAmount = $t04257642867._1
1269+ let claimedAsset = $t04257642867._2
12331270 let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options)
12341271 let change = (claimedAmount - amountToExchange)
12351272 let changeEntry = if ((change > 0))
12361273 then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))]
12371274 else nil
1238- (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry)
1275+ (capitalize(pool, pType, tokenToId, exchangedAmount) ++ changeEntry)
12391276 })
12401277
12411278
12461283 else false)
12471284 then throw("Wrong type")
12481285 else {
1249- let $t04243942533 = getPoolData(Address(fromBase58String(poolAddr)), type)
1250- let aId = $t04243942533._1
1251- let bId = $t04243942533._2
1252- let aBal = $t04243942533._3
1253- let bBal = $t04243942533._4
1254- let shareId = $t04243942533._5
1286+ let $t04360943703 = getPoolData(Address(fromBase58String(poolAddr)), type)
1287+ let aId = $t04360943703._1
1288+ let bId = $t04360943703._2
1289+ let aBal = $t04360943703._3
1290+ let bBal = $t04360943703._4
1291+ let shareId = $t04360943703._5
12551292 [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kAxlyStopLossNoLoanFee), stoplossFeeNoLoan), IntegerEntry((poolAddr + kAxlyStopLossLoanFee), stoplossFeeWithLoan), IntegerEntry((poolAddr + kPoolInterestLoan), 0), IntegerEntry((poolAddr + kPoolInterestNoLoan), 0), StringEntry((kPool + poolAddr), type), StringEntry((shareId + kSharePool), poolAddr), BooleanEntry((poolAddr + kPoolCanBorrow), canBorrow)]
12561293 })
12571294
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SF_POOL = "SF"
55
66 let WX_POOL = "WX"
77
88 let CAP_FEE_NO_LOAN = "capNoLoan"
99
1010 let CAP_FEE_LOAN = "capLoan"
1111
1212 let STOPLOSS_FEE_NO_LOAN = "stopLossNoLoan"
1313
1414 let STOPLOSS_LOAN = "stopLossLoan"
1515
1616 let LOAN_FEE = "loan"
1717
1818 let NO_LOAN_FEE = "noLoan"
1919
2020 let NO_FEE = "noFee"
2121
2222 let SCALE8 = 100000000
2323
2424 let SCALE10 = 10000000000
2525
2626 let SCALE16 = toBigInt(10000000000000000)
2727
2828 let FEE_SCALE6 = 1000000
2929
3030 let kSFPoolAAssetBalance = "A_asset_balance"
3131
3232 let kSFPoolBAssetBalance = "B_asset_balance"
3333
3434 let kSFPoolAAssetId = "A_asset_id"
3535
3636 let kSFPoolBAssetId = "B_asset_id"
3737
3838 let kSFPoolShareId = "share_asset_id"
3939
4040 let kSFPoolShareSupply = "share_asset_supply"
4141
4242 let kSFPoolFee = "commission"
4343
44-let kUserPosition = "_user_position"
44+let kUserPosition = "_userPosition"
4545
46-let kUserPositionPool = "_user_position_pool"
46+let kUserPositionPool = "_userPositionPool"
4747
48-let kUserBorrowAmount = "_user_position_borrow_amount"
48+let kUserBorrowAmount = "_userPositionBorrowAmount"
4949
50-let kUserBorrowAssetId = "_user_position_borrow_asset_id"
50+let kUserBorrowAssetId = "_userPositionBorrowAssetId"
5151
52-let kUserPositionNum = "_user_position_number"
52+let kUserPositionNum = "_userPositionNumber"
5353
54-let kUserPositionInterest = "_user_position_interest"
54+let kUserPositionInterest = "_userPositionInterest"
5555
56-let kPoolTotal = "_pool_total"
56+let kPoolTotal = "_poolTotal"
5757
58-let kPoolTotalLoan = "_pool_total_loan"
58+let kPoolTotalLoan = "_poolTotalLoan"
5959
60-let kPoolInterestLoan = "_pool_interest_loan"
60+let kPoolInterestLoan = "_poolInterestLoan"
6161
62-let kPoolInterestNoLoan = "_pool_interest_no_loan"
62+let kPoolInterestNoLoan = "_poolInterestNoLoan"
6363
64-let kPoolCanBorrow = "_pool_can_borrow"
64+let kPoolCanBorrow = "_poolCanBorrow"
6565
66-let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan"
66+let kAxlyInFeeWithoutLoan = "_axlyFeeNoLoan"
6767
68-let kAxlyInFeeWithLoan = "_axly_fee_with_loan"
68+let kAxlyInFeeWithLoan = "_axlyFeeWithLoan"
6969
70-let kAxlyNoLoanCapFee = "_axly_fee_cap_with_loan"
70+let kAxlyNoLoanCapFee = "_axlyFeeCapWithLoan"
7171
72-let kAxlyWithLoanCapFee = "_axly_fee_cap_no_loan"
72+let kAxlyWithLoanCapFee = "_axlyFeeCapNoLoan"
7373
74-let kAxlyStopLossNoLoanFee = "_axly_fee_stoploss_with_loan"
74+let kAxlyStopLossNoLoanFee = "_axlyFeeStoplossWithLoan"
7575
76-let kAxlyStopLossLoanFee = "_axly_fee_stoploss_no_loan"
76+let kAxlyStopLossLoanFee = "_axlyFeeStoplossNoLoan"
7777
7878 let kRequestId = "_request_id"
7979
8080 let kRequestIter = "requests_iter"
8181
8282 let kPool = "pool_"
8383
84-let kSharePool = "_pool_share_id"
84+let kSharePool = "_poolShareId"
8585
86-let kPoolCapChange = "_pool_cap_change"
86+let kPoolCapChange = "_poolCapChange"
8787
8888 let kTokenLastPrice = "last_price"
8989
9090 let kPriceInOracle = "_twap5B"
9191
92-let kUserStopLoss = "_stop_loss"
92+let kUserStopLoss = "_stopLoss"
9393
9494 let kMoneyBox = "axly_money_box"
9595
9696 let kSFFarmingAddr = "swopfi_farming_addr"
9797
9898 let kLendService = "lend_service_addr"
9999
100100 let kAdminCallPK = "admin_call_pub_key"
101101
102102 let kPriceOracle = "price_oracle"
103103
104104 let kExContract = "exchange_contract"
105105
106106 let kWxSwapContract = "wx_swap_contract"
107107
108108 let kSwopId = "swop_id"
109109
110110 let kWxId = "wx_id"
111111
112112 let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address")))
113113
114114 let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address")))
115115
116116 let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address")))
117117
118118 let wxSwapContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kWxSwapContract), "No wx swap address")))
119119
120120 let SWOPID = fromBase58String(valueOrErrorMessage(getString(this, kSwopId), "No swop id"))
121121
122122 let WXID = fromBase58String(valueOrErrorMessage(getString(this, kWxId), "No wx id"))
123+
124+func unknownPoolType () = throw("Wrong pool type")
125+
123126
124127 func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr")))
125128
126129
127130 func getAdminCallAddr () = addressFromPublicKey(fromBase58String(valueOrErrorMessage(getString(this, kAdminCallPK), "Can't get admin addr")))
128131
129132
130133 func isAdminCall (i) = if ((i.caller == getAdminCallAddr()))
131134 then unit
132135 else throw("Only admin can call this function")
133136
134137
135138 func isSelfCall (i) = if ((i.caller == this))
136139 then unit
137140 else throw("Only contract itself can call this function")
138141
139142
140143 func isLandCall (i) = if ((i.caller == getLendSrvAddr()))
141144 then unit
142145 else throw("Only land contract can call this function")
143146
144147
145148 func accountBalance (assetId) = match assetId {
146149 case id: ByteVector =>
147150 assetBalance(this, id)
148151 case waves: Unit =>
149152 wavesBalance(this).available
150153 case _ =>
151154 throw("Match error")
152155 }
153156
154157
155158 func getSFPoolBalances (poolAddr) = $Tuple2(valueOrErrorMessage(getInteger(poolAddr, kSFPoolAAssetBalance), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolBAssetBalance), "Can't get pool B asset balance"))
156159
157160
158161 func getWXPoolBalances (poolAddr,aId,bId) = $Tuple2({
159162 let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [aId], nil)
160163 if ($isInstanceOf(@, "Int"))
161164 then @
162165 else throw(($getType(@) + " couldn't be cast to Int"))
163166 }, {
164167 let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [bId], nil)
165168 if ($isInstanceOf(@, "Int"))
166169 then @
167170 else throw(($getType(@) + " couldn't be cast to Int"))
168171 })
169172
170173
171174 func getPoolBalances (poolAddr,type,aId,bId) = if ((type == SF_POOL))
172175 then getSFPoolBalances(poolAddr)
173176 else if ((type == WX_POOL))
174177 then getWXPoolBalances(poolAddr, aId, bId)
175- else throw("Wrong pool type")
178+ else unknownPoolType()
176179
177180
178181 func getSFPoolData (poolAddr) = {
179- let $t061916240 = getSFPoolBalances(poolAddr)
180- if (($t061916240 == $t061916240))
182+ let $t061796228 = getSFPoolBalances(poolAddr)
183+ if (($t061796228 == $t061796228))
181184 then {
182- let balB = $t061916240._2
183- let balA = $t061916240._1
185+ let balB = $t061796228._2
186+ let balA = $t061796228._1
184187 $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), balA, balB, valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id"))
185188 }
186189 else throw("Strict value is not equal to itself.")
187190 }
188191
189192
190193 func getWXPoolData (poolAddr) = {
191194 let cfg = {
192195 let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil)
193196 if ($isInstanceOf(@, "List[Any]"))
194197 then @
195198 else throw(($getType(@) + " couldn't be cast to List[Any]"))
196199 }
197200 if ((cfg == cfg))
198201 then {
199202 let aId = valueOrErrorMessage({
200203 let @ = cfg[4]
201204 if ($isInstanceOf(@, "String"))
202205 then @
203206 else unit
204207 }, "Can't get pool A asset id")
205208 let bId = valueOrErrorMessage({
206209 let @ = cfg[5]
207210 if ($isInstanceOf(@, "String"))
208211 then @
209212 else unit
210213 }, "Can't get pool B asset id")
211214 let shareId = valueOrErrorMessage({
212215 let @ = cfg[3]
213216 if ($isInstanceOf(@, "String"))
214217 then @
215218 else unit
216219 }, "Can't get pool LP asset id")
217- let $t069376996 = getWXPoolBalances(poolAddr, aId, bId)
218- if (($t069376996 == $t069376996))
220+ let $t069256984 = getWXPoolBalances(poolAddr, aId, bId)
221+ if (($t069256984 == $t069256984))
219222 then {
220- let balB = $t069376996._2
221- let balA = $t069376996._1
223+ let balB = $t069256984._2
224+ let balA = $t069256984._1
222225 $Tuple5(aId, bId, balA, balB, shareId)
223226 }
224227 else throw("Strict value is not equal to itself.")
225228 }
226229 else throw("Strict value is not equal to itself.")
227230 }
228231
229232
230233 func getPoolData (poolAddr,type) = if ((type == SF_POOL))
231234 then getSFPoolData(poolAddr)
232235 else if ((type == WX_POOL))
233236 then getWXPoolData(poolAddr)
234- else throw("Wrong pool type")
237+ else unknownPoolType()
235238
236239
237240 func getShareSupply (poolAddr,type,shareId) = if ((type == SF_POOL))
238241 then valueOrErrorMessage(getInteger(poolAddr, kSFPoolShareSupply), "Can't get share asset supply")
239242 else if ((type == WX_POOL))
240243 then valueOrErrorMessage(assetInfo(fromBase58String(shareId)), "Wrong ShareId").quantity
241- else throw("Wrong pool type")
244+ else unknownPoolType()
242245
243246
244247 func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0)
245248
246249
247250 func getPoolTotalShareWithLoan (pool) = valueOrElse(getInteger(this, (pool + kPoolTotalLoan)), 0)
248251
249252
250253 func getNewUserPositionNumber (user) = (valueOrElse(getInteger(this, (user + kUserPositionNum)), 0) + 1)
251254
252255
253256 func getAxlyFee (pool,feeType) = if ((feeType == CAP_FEE_LOAN))
254257 then getIntegerValue(this, (pool + kAxlyWithLoanCapFee))
255258 else if ((feeType == CAP_FEE_NO_LOAN))
256259 then getIntegerValue(this, (pool + kAxlyNoLoanCapFee))
257260 else if ((feeType == LOAN_FEE))
258261 then getIntegerValue(this, (pool + kAxlyInFeeWithLoan))
259262 else if ((feeType == NO_LOAN_FEE))
260263 then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan))
261264 else if ((feeType == NO_FEE))
262265 then 0
263266 else throw("Wrong fee type")
264267
265268
266269 func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr")))
267270
268271
269272 func getWXFarmingAddr (poolAddr) = {
270273 let fContract = Address(fromBase58String(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr")))
271274 let factroyCfg = split(valueOrErrorMessage(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__")
272275 Address(fromBase58String(factroyCfg[1]))
273276 }
274277
275278
276279 func assetIdToStr (assetId) = match assetId {
277280 case id: ByteVector =>
278281 toBase58String(id)
279282 case waves: Unit =>
280283 "WAVES"
281284 case _ =>
282285 throw("Not Asset id")
283286 }
284287
285288
286289 func assetIdFromStr (assetId) = if ((assetId == "WAVES"))
287290 then unit
288291 else fromBase58String(assetId)
289292
290293
291294 func getAssetDecimals (assetId) = if ((assetId == "WAVES"))
292295 then 8
293296 else match assetInfo(fromBase58String(assetId)) {
294297 case asset: Asset =>
295298 asset.decimals
296299 case _ =>
297300 throw("Can't find asset")
298301 }
299302
300303
301304 func getAssetPrecition (assetId) = pow(10, 0, getAssetDecimals(assetId), 0, 0, DOWN)
302305
303306
304307 func getAssetsPrice (assetIds) = {
305308 func getPrices (a,assetId) = {
306309 let assetPrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle))
307310 (a :+ assetPrice)
308311 }
309312
310313 let $l = assetIds
311314 let $s = size($l)
312315 let $acc0 = nil
313316 func $f0_1 ($a,$i) = if (($i >= $s))
314317 then $a
315318 else getPrices($a, $l[$i])
316319
317320 func $f0_2 ($a,$i) = if (($i >= $s))
318321 then $a
319322 else throw("List size exceeds 50")
320323
321324 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50)
322325 }
323326
324327
325328 func getSharePrice (shareId) = {
326329 let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id")
327330 let poolAddr = Address(fromBase58String(pool))
328331 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
329- let $t0998810053 = getPoolData(poolAddr, pType)
330- let aId = $t0998810053._1
331- let bId = $t0998810053._2
332- let aBalance = $t0998810053._3
333- let bBalance = $t0998810053._4
332+ let $t0996210027 = getPoolData(poolAddr, pType)
333+ let aId = $t0996210027._1
334+ let bId = $t0996210027._2
335+ let aBalance = $t0996210027._3
336+ let bBalance = $t0996210027._4
334337 let dPriceA = getIntegerValue(priceOracleAddr, (aId + kPriceInOracle))
335338 let dPriceB = getIntegerValue(priceOracleAddr, (bId + kPriceInOracle))
336339 let shareSupply = getShareSupply(poolAddr, pType, shareId)
337340 let APrecision = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN)
338341 let BPrecision = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN)
339342 let sharePrecision = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN)
340343 let sum = (fraction(aBalance, dPriceA, APrecision) + fraction(bBalance, dPriceB, BPrecision))
341344 fraction(sum, sharePrecision, shareSupply)
342345 }
343346
344347
345348 func getSharePrices (shareIds) = {
346349 func getPrices (a,shareId) = (a :+ getSharePrice(shareId))
347350
348351 let $l = shareIds
349352 let $s = size($l)
350353 let $acc0 = nil
351354 func $f0_1 ($a,$i) = if (($i >= $s))
352355 then $a
353356 else getPrices($a, $l[$i])
354357
355358 func $f0_2 ($a,$i) = if (($i >= $s))
356359 then $a
357360 else throw("List size exceeds 20")
358361
359362 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
360363 }
361364
362365
363366 func getCursEntries (aId,bId,shareId,wAmounts) = {
364367 let assetsPrices = getAssetsPrice([aId, bId])
365368 let sharePrice = getSharePrice(shareId)
366369 let prices = ([toString(assetsPrices[0]), toString(assetsPrices[1]), toString(sharePrice)] ++ wAmounts)
367370 [StringEntry(kTokenLastPrice, makeString(prices, ","))]
368371 }
369372
370373
371374 func calcReplenishByTwoTokens (pType,poolAddr,pmtA,aId,pmtB,bId,balA,balB) = if ((pType == SF_POOL))
372375 then {
373376 let repl = {
374377 let @ = invoke(poolAddr, "callFunction", ["calcLPReplenishTwoTokensREADONLY", [toString(pmtA), toString(pmtB)]], nil)
375378 if ($isInstanceOf(@, "List[Any]"))
376379 then @
377380 else throw(($getType(@) + " couldn't be cast to List[Any]"))
378381 }
379382 if ((repl == repl))
380383 then $Tuple5({
381384 let @ = repl[3]
382385 if ($isInstanceOf(@, "Int"))
383386 then @
384387 else throw(($getType(@) + " couldn't be cast to Int"))
385388 }, {
386389 let @ = repl[4]
387390 if ($isInstanceOf(@, "Int"))
388391 then @
389392 else throw(($getType(@) + " couldn't be cast to Int"))
390393 }, {
391394 let @ = repl[1]
392395 if ($isInstanceOf(@, "Int"))
393396 then @
394397 else throw(($getType(@) + " couldn't be cast to Int"))
395398 }, assetIdToStr(repl[2]), {
396399 let @ = repl[0]
397400 if ($isInstanceOf(@, "Int"))
398401 then @
399402 else throw(($getType(@) + " couldn't be cast to Int"))
400403 })
401404 else throw("Strict value is not equal to itself.")
402405 }
403- else {
404- let $t01157311823 = $Tuple2(split({
405- let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil)
406- if ($isInstanceOf(@, "String"))
407- then @
408- else throw(($getType(@) + " couldn't be cast to String"))
409- }, "__"), split({
410- let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil)
411- if ($isInstanceOf(@, "String"))
412- then @
413- else throw(($getType(@) + " couldn't be cast to String"))
414- }, "__"))
415- if (($t01157311823 == $t01157311823))
416- then {
417- let evalPutInB = $t01157311823._2
418- let evalPutInA = $t01157311823._1
419- let lpInA = parseIntValue(evalPutInA[1])
420- let lpInB = parseIntValue(evalPutInB[1])
421- if ((lpInB > lpInA))
422- then {
423- let pmt = parseIntValue(evalPutInA[8])
424- $Tuple5(pmtA, pmt, (pmtB - pmt), bId, lpInB)
425- }
426- else {
427- let pmt = parseIntValue(evalPutInB[7])
428- $Tuple5(pmt, pmtB, (pmtA - pmt), aId, lpInA)
429- }
430- }
431- else throw("Strict value is not equal to itself.")
432- }
406+ else if ((pType == WX_POOL))
407+ then {
408+ let $t01157211822 = $Tuple2(split({
409+ let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil)
410+ if ($isInstanceOf(@, "String"))
411+ then @
412+ else throw(($getType(@) + " couldn't be cast to String"))
413+ }, "__"), split({
414+ let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil)
415+ if ($isInstanceOf(@, "String"))
416+ then @
417+ else throw(($getType(@) + " couldn't be cast to String"))
418+ }, "__"))
419+ if (($t01157211822 == $t01157211822))
420+ then {
421+ let evalPutInB = $t01157211822._2
422+ let evalPutInA = $t01157211822._1
423+ let lpInA = parseIntValue(evalPutInA[1])
424+ let lpInB = parseIntValue(evalPutInB[1])
425+ if ((lpInB > lpInA))
426+ then {
427+ let pmt = parseIntValue(evalPutInA[8])
428+ $Tuple5(pmtA, pmt, (pmtB - pmt), bId, lpInB)
429+ }
430+ else {
431+ let pmt = parseIntValue(evalPutInB[7])
432+ $Tuple5(pmt, pmtB, (pmtA - pmt), aId, lpInA)
433+ }
434+ }
435+ else throw("Strict value is not equal to itself.")
436+ }
437+ else unknownPoolType()
433438
434439
435440 func replenishTwoTokensByType (poolAddr,pType,pmtA,aId,pmtB,bId) = {
436441 let payments = [AttachedPayment(assetIdFromStr(aId), pmtA), AttachedPayment(assetIdFromStr(bId), pmtB)]
437442 if ((pType == SF_POOL))
438443 then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments)
439- else invoke(poolAddr, "put", [1000000, false], payments)
444+ else if ((pType == WX_POOL))
445+ then invoke(poolAddr, "put", [1000000, false], payments)
446+ else unknownPoolType()
440447 }
441448
442449
443450 func replenishOneTokenByType (poolAddr,pType,pmt,pmtId) = {
444451 let payments = [AttachedPayment(assetIdFromStr(pmtId), pmt)]
445452 if ((pType == SF_POOL))
446453 then invoke(poolAddr, "callFunction", ["replenishWithOneToken", ["0", "false", "0"]], payments)
447- else invoke(poolAddr, "putOneTkn", [0, false], payments)
454+ else if ((pType == WX_POOL))
455+ then invoke(poolAddr, "putOneTkn", [0, false], payments)
456+ else unknownPoolType()
448457 }
449458
450459
451460 func stakeLP (pool,pType,shareId,amount) = {
452461 let payments = [AttachedPayment(fromBase58String(shareId), amount)]
453462 if ((pType == SF_POOL))
454463 then invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], payments)
455- else invoke(getWXFarmingAddr(addressFromStringValue(pool)), "stake", nil, payments)
464+ else if ((pType == WX_POOL))
465+ then invoke(getWXFarmingAddr(addressFromStringValue(pool)), "stake", nil, payments)
466+ else unknownPoolType()
456467 }
457468
458469
459470 func unstakeLP (pool,pType,shareId,amount) = {
460- let $t01330813665 = if ((pType == SF_POOL))
471+ let $t01348113831 = if ((pType == SF_POOL))
461472 then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount])
462473 else if ((pType == WX_POOL))
463474 then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount])
464- else throw("Wrong pool type")
465- let farmAddr = $t01330813665._1
466- let fName = $t01330813665._2
467- let params = $t01330813665._3
475+ else unknownPoolType()
476+ let farmAddr = $t01348113831._1
477+ let fName = $t01348113831._2
478+ let params = $t01348113831._3
468479 let inv = invoke(farmAddr, fName, params, nil)
469480 if ((inv == inv))
470481 then amount
471482 else throw("Strict value is not equal to itself.")
472483 }
473484
474485
475486 func calcAmountToPaySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = {
476487 let poolAddr = Address(fromBase58String(pool))
477488 let feeScale6 = 1000000
478489 let fee = getIntegerValue(poolAddr, kSFPoolFee)
479490 let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee), CEILING)
480- let $t01408714393 = if ((assetTokenToGet == assetIdA))
491+ let $t01425314559 = if ((assetTokenToGet == assetIdA))
481492 then {
482493 let amountToPay = fraction(amntGetNoFee, balB, (balA - amntGetNoFee), CEILING)
483494 $Tuple2(amountToPay, assetIdB)
484495 }
485496 else {
486497 let amountToPay = fraction(amntGetNoFee, balA, (balB - amntGetNoFee), CEILING)
487498 $Tuple2(amountToPay, assetIdA)
488499 }
489- let amountToPay = $t01408714393._1
490- let assetToPay = $t01408714393._2
500+ let amountToPay = $t01425314559._1
501+ let assetToPay = $t01425314559._2
491502 $Tuple2(assetToPay, amountToPay)
492503 }
493504
494505
495506 func calcAmountToPayWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = {
496507 let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee")
497508 let pFee = getIntegerValue(wxSwapContract, "%s__poolFee")
498509 let feeScale = toBigInt(100000000)
499- let $t01473215040 = if ((assetTokenToGet == assetIdA))
510+ let $t01489815206 = if ((assetTokenToGet == assetIdA))
500511 then {
501512 let amountToPay = fraction(amountTokenToGet, balB, (balA - amountTokenToGet))
502513 $Tuple2(amountToPay, assetIdB)
503514 }
504515 else {
505516 let amountToPay = fraction(amountTokenToGet, balA, (balB - amountTokenToGet))
506517 $Tuple2(amountToPay, assetIdA)
507518 }
508- let amountToPay = $t01473215040._1
509- let assetToPay = $t01473215040._2
519+ let amountToPay = $t01489815206._1
520+ let assetToPay = $t01489815206._2
510521 let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))), CEILING))
511522 $Tuple2(assetToPay, amountToPayWithFee)
512523 }
513524
514525
515-func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL))
526+func exchangeDirectly (pType,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((pType == SF_POOL))
516527 then {
517- let $t01538515507 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
518- let assetToPay = $t01538515507._1
519- let amountToPay = $t01538515507._2
528+ let $t01555315675 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
529+ let assetToPay = $t01555315675._1
530+ let amountToPay = $t01555315675._2
520531 invoke(addressFromStringValue(pool), "callFunction", ["exchange", [toString(amountTokenToGet)]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)])
521532 }
522- else {
523- let $t01568215804 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
524- let assetToPay = $t01568215804._1
525- let amountToPay = $t01568215804._2
526- invoke(wxSwapContract, "swap", [amountTokenToGet, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)])
527- }
533+ else if ((pType == WX_POOL))
534+ then {
535+ let $t01587515997 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
536+ let assetToPay = $t01587515997._1
537+ let amountToPay = $t01587515997._2
538+ invoke(wxSwapContract, "swap", [amountTokenToGet, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)])
539+ }
540+ else unknownPoolType()
528541
529542
530543 func calcWithdrawLPFromPoolVirt (poolAddr,pType,shareId,userCanWithdraw) = {
531- let $t01606616453 = if ((pType == SF_POOL))
544+ let $t01628416723 = if ((pType == SF_POOL))
532545 then {
533546 let inv = {
534547 let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(userCanWithdraw)]], nil)
535548 if ($isInstanceOf(@, "(Int, Int)"))
536549 then @
537550 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
538551 }
539552 if ((inv == inv))
540553 then $Tuple2(inv._1, inv._2)
541554 else throw("Strict value is not equal to itself.")
542555 }
543- else {
544- let inv = split({
545- let @ = invoke(poolAddr, "evaluateGetREADONLY", [shareId, userCanWithdraw], nil)
546- if ($isInstanceOf(@, "String"))
547- then @
548- else throw(($getType(@) + " couldn't be cast to String"))
549- }, "__")
550- if ((inv == inv))
551- then $Tuple2(parseIntValue(inv[1]), parseIntValue(inv[2]))
552- else throw("Strict value is not equal to itself.")
553- }
554- let amountA = $t01606616453._1
555- let amountB = $t01606616453._2
556+ else if ((pType == WX_POOL))
557+ then {
558+ let inv = split({
559+ let @ = invoke(poolAddr, "evaluateGetREADONLY", [shareId, userCanWithdraw], nil)
560+ if ($isInstanceOf(@, "String"))
561+ then @
562+ else throw(($getType(@) + " couldn't be cast to String"))
563+ }, "__")
564+ if ((inv == inv))
565+ then $Tuple2(parseIntValue(inv[1]), parseIntValue(inv[2]))
566+ else throw("Strict value is not equal to itself.")
567+ }
568+ else unknownPoolType()
569+ let amountA = $t01628416723._1
570+ let amountB = $t01628416723._2
556571 $Tuple2(amountA, amountB)
557572 }
558573
559574
560-func claimFarmed (type,pool) = if ((type == SF_POOL))
575+func claimFarmed (pType,pool) = if ((pType == SF_POOL))
561576 then {
562577 let balBefore = accountBalance(SWOPID)
563578 if ((balBefore == balBefore))
564579 then {
565580 let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil)
566581 if ((inv == inv))
567582 then {
568583 let balAfter = accountBalance(SWOPID)
569584 $Tuple2((balAfter - balBefore), SWOPID)
570585 }
571586 else throw("Strict value is not equal to itself.")
572587 }
573588 else throw("Strict value is not equal to itself.")
574589 }
575- else if ((type == WX_POOL))
590+ else if ((pType == WX_POOL))
576591 then {
577592 let balBefore = accountBalance(WXID)
578593 if ((balBefore == balBefore))
579594 then {
580595 let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil)
581596 if ((inv == inv))
582597 then {
583598 let balAfter = accountBalance(WXID)
584599 $Tuple2((balAfter - balBefore), WXID)
585600 }
586601 else throw("Strict value is not equal to itself.")
587602 }
588603 else throw("Strict value is not equal to itself.")
589604 }
590- else throw("Wrong pool type")
605+ else unknownPoolType()
591606
592607
593608 func replenishByType (pType,pool,feeType,pmtA,aId,pmtB,bId,balA,balB,LPId) = {
594609 let lpBalanceBefore = accountBalance(fromBase58String(LPId))
595610 if ((lpBalanceBefore == lpBalanceBefore))
596611 then {
597612 let poolAddr = addressFromStringValue(pool)
598- let $t01743917855 = if (if ((pmtA > 0))
613+ let $t01768818104 = if (if ((pmtA > 0))
599614 then (pmtB > 0)
600615 else false)
601616 then {
602- let $t01750517621 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
603- let pmtInA = $t01750517621._1
604- let pmtInB = $t01750517621._2
605- let change = $t01750517621._3
606- let changeId = $t01750517621._4
617+ let $t01775417870 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
618+ let pmtInA = $t01775417870._1
619+ let pmtInB = $t01775417870._2
620+ let change = $t01775417870._3
621+ let changeId = $t01775417870._4
607622 let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId)
608623 if ((inv == inv))
609624 then $Tuple2(change, changeId)
610625 else throw("Strict value is not equal to itself.")
611626 }
612627 else if ((pmtA > 0))
613628 then $Tuple2(pmtA, aId)
614629 else if ((pmtB > 0))
615630 then $Tuple2(pmtB, bId)
616631 else throw("pmts must be > 0")
617- let change = $t01743917855._1
618- let changeId = $t01743917855._2
632+ let change = $t01768818104._1
633+ let changeId = $t01768818104._2
619634 let inv = if ((change > 0))
620635 then replenishOneTokenByType(poolAddr, pType, change, changeId)
621636 else nil
622637 if ((inv == inv))
623638 then {
624639 let lpBalanceAfter = accountBalance(fromBase58String(LPId))
625640 let totalStaked = (lpBalanceAfter - lpBalanceBefore)
626641 let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6)
627642 let userShareForStake = (totalStaked - axlyFeeAmount)
628643 if ((0 >= userShareForStake))
629644 then throw("amount of staked sharetokens must be > 0")
630645 else {
631646 let invLP = stakeLP(pool, pType, LPId, userShareForStake)
632647 if ((invLP == invLP))
633648 then $Tuple2(userShareForStake, axlyFeeAmount)
634649 else throw("Strict value is not equal to itself.")
635650 }
636651 }
637652 else throw("Strict value is not equal to itself.")
638653 }
639654 else throw("Strict value is not equal to itself.")
640655 }
641656
642657
643658 func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = {
644659 let totalAmount = getPoolTotalShare(pool)
645660 let totalAmountLoan = getPoolTotalShareWithLoan(pool)
646- let $t01871318951 = if (withLoan)
661+ let $t01896219200 = if (withLoan)
647662 then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount))
648663 else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan)
649- let curPoolInterest = $t01871318951._1
650- let totalStakedWithLoan = $t01871318951._2
664+ let curPoolInterest = $t01896219200._1
665+ let totalStakedWithLoan = $t01896219200._2
651666 [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), totalStakedWithLoan), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), StringEntry((((user + "_") + toString(posNum)) + kUserPositionPool), pool), IntegerEntry((user + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))]
652667 }
653668
654669
655670 func exchangeKeeper (toToken,pmtAmount,pmtAsset,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = {
656671 let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken))
657672 if ((tokenBalanceBefore == tokenBalanceBefore))
658673 then {
659674 let inv = invoke(exContract, "swap", [amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options], [AttachedPayment(pmtAsset, pmtAmount)])
660675 if ((inv == inv))
661676 then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore)
662677 else throw("Strict value is not equal to itself.")
663678 }
664679 else throw("Strict value is not equal to itself.")
665680 }
666681
667682
668683 func exchangePuzzle (toToken,pmtAmount,pmtAsset,routesStr,minToReceive,options) = {
669684 let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken))
670685 if ((tokenBalanceBefore == tokenBalanceBefore))
671686 then {
672687 let inv = invoke(exContract, "puzzleSwap", [routesStr, minToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)])
673688 if ((inv == inv))
674689 then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore)
675690 else throw("Strict value is not equal to itself.")
676691 }
677692 else throw("Strict value is not equal to itself.")
678693 }
679694
680695
681696 func exchangeSwopFi (toToken,pmtAmount,pmtAsset,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = {
682697 let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken))
683698 if ((tokenBalanceBefore == tokenBalanceBefore))
684699 then {
685700 let inv = invoke(exContract, "swopfiSwap", [exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)])
686701 if ((inv == inv))
687702 then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore)
688703 else throw("Strict value is not equal to itself.")
689704 }
690705 else throw("Strict value is not equal to itself.")
691706 }
692707
693708
694709 func capitalize (pool,pType,tokenId,tokenAmount) = {
695710 let poolAddr = Address(fromBase58String(pool))
696- let $t02130221368 = getPoolData(poolAddr, pType)
697- let AId = $t02130221368._1
698- let BId = $t02130221368._2
699- let balA = $t02130221368._3
700- let balB = $t02130221368._4
701- let shareId = $t02130221368._5
711+ let $t02155121617 = getPoolData(poolAddr, pType)
712+ let AId = $t02155121617._1
713+ let BId = $t02155121617._2
714+ let balA = $t02155121617._3
715+ let balB = $t02155121617._4
716+ let shareId = $t02155121617._5
702717 if (if ((tokenId != AId))
703718 then (tokenId != BId)
704719 else false)
705720 then throw("Wrong asset")
706721 else {
707- let $t02145321533 = if ((tokenId == AId))
722+ let $t02170221782 = if ((tokenId == AId))
708723 then $Tuple2(tokenAmount, 0)
709724 else $Tuple2(0, tokenAmount)
710- let pmtA = $t02145321533._1
711- let pmtB = $t02145321533._2
712- let $t02153621640 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
713- let stakedAmount = $t02153621640._1
714- let nf = $t02153621640._2
725+ let pmtA = $t02170221782._1
726+ let pmtB = $t02170221782._2
727+ let $t02178521889 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
728+ let stakedAmount = $t02178521889._1
729+ let nf = $t02178521889._2
715730 let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0)
716731 let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0)
717732 let totalShareAmount = getPoolTotalShare(pool)
718733 let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool)
719734 let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount)
720735 let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8)
721736 let stakedNoLoan = (stakedAmount - stakedLoan)
722737 let newInterestLoan = if ((totalShareAmountWithLoan > 0))
723738 then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan))
724739 else 0
725740 let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0))
726741 then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan)))
727742 else 0
728743 let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6)
729744 let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6)
730745 let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan))
731746 if ((axlyFee == axlyFee))
732747 then ([IntegerEntry((pool + kPoolInterestLoan), newInterestLoan), IntegerEntry((pool + kPoolInterestNoLoan), newInterestNoLoan), IntegerEntry((pool + kPoolTotal), ((totalShareAmount + stakedAmount) - axlyFee)), IntegerEntry((pool + kPoolTotalLoan), ((totalShareAmountWithLoan + stakedLoan) - axlyFeeLoan)), ScriptTransfer(moneyBox, (axlyFeeLoan + axlyFeeNoLoan), fromBase58String(shareId))] ++ getCursEntries(AId, BId, shareId, nil))
733748 else throw("Strict value is not equal to itself.")
734749 }
735750 }
736751
737752
738-func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = {
753+func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset,stopLossFee) = {
739754 let poolAddr = Address(fromBase58String(pool))
740755 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool")
741- let $t02341223488 = getPoolData(poolAddr, pType)
742- let assetIdA = $t02341223488._1
743- let assetIdB = $t02341223488._2
744- let balA = $t02341223488._3
745- let balB = $t02341223488._4
746- let shareId = $t02341223488._5
756+ let $t02367923755 = getPoolData(poolAddr, pType)
757+ let assetIdA = $t02367923755._1
758+ let assetIdB = $t02367923755._2
759+ let balA = $t02367923755._3
760+ let balB = $t02367923755._4
761+ let shareId = $t02367923755._5
747762 let cBalABefore = accountBalance(assetIdFromStr(assetIdA))
748763 if ((cBalABefore == cBalABefore))
749764 then {
750765 let cBalBBefore = accountBalance(assetIdFromStr(assetIdB))
751766 if ((cBalBBefore == cBalBBefore))
752767 then {
753768 let inv = if ((pType == SF_POOL))
754- then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil)
755- else {
756- let inv = unstakeLP(pool, pType, shareId, userCanWithdraw)
769+ then {
770+ let inv = unstakeLP(pool, pType, shareId, stopLossFee)
757771 if ((inv == inv))
758- then invoke(poolAddr, "get", nil, [AttachedPayment(assetIdFromStr(shareId), userCanWithdraw)])
772+ then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil)
759773 else throw("Strict value is not equal to itself.")
760774 }
775+ else if ((pType == WX_POOL))
776+ then {
777+ let inv = unstakeLP(pool, pType, shareId, (userCanWithdraw + stopLossFee))
778+ if ((inv == inv))
779+ then invoke(poolAddr, "get", nil, [AttachedPayment(assetIdFromStr(shareId), userCanWithdraw)])
780+ else throw("Strict value is not equal to itself.")
781+ }
782+ else unknownPoolType()
761783 if ((inv == inv))
762784 then {
763785 let cBalAAfter = accountBalance(assetIdFromStr(assetIdA))
764786 let cBalBAfter = accountBalance(assetIdFromStr(assetIdB))
765- let $t02405124140 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore))
766- let tokensAmountA = $t02405124140._1
767- let tokensAmountB = $t02405124140._2
768- let $t02414324997 = if ((debt > 0))
787+ let $t02444824537 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore))
788+ let tokensAmountA = $t02444824537._1
789+ let tokensAmountB = $t02444824537._2
790+ let $t02454025394 = if ((debt > 0))
769791 then {
770792 let amountToGetEx = if (if ((borrowAsset == assetIdA))
771793 then (debt > tokensAmountA)
772794 else false)
773795 then (debt - tokensAmountA)
774796 else if (if ((borrowAsset == assetIdB))
775797 then (debt > tokensAmountB)
776798 else false)
777799 then (debt - tokensAmountB)
778800 else 0
779801 let exInv = if ((amountToGetEx > 0))
780802 then exchangeDirectly(pType, pool, assetIdA, assetIdB, (balA - tokensAmountA), (balB - tokensAmountB), amountToGetEx, borrowAsset)
781803 else nil
782804 if ((exInv == exInv))
783805 then {
784806 let cBalAAfterRepay = accountBalance(assetIdFromStr(assetIdA))
785807 let cBalBAfterRepay = accountBalance(assetIdFromStr(assetIdB))
786808 if ((borrowAsset == assetIdA))
787809 then $Tuple2(((cBalAAfterRepay - cBalABefore) - debt), (cBalBAfterRepay - cBalBBefore))
788810 else $Tuple2((cBalAAfterRepay - cBalABefore), ((cBalBAfterRepay - cBalBBefore) - debt))
789811 }
790812 else throw("Strict value is not equal to itself.")
791813 }
792814 else $Tuple2(tokensAmountA, tokensAmountB)
793- let toUserA = $t02414324997._1
794- let toUserB = $t02414324997._2
815+ let toUserA = $t02454025394._1
816+ let toUserB = $t02454025394._2
795817 $Tuple7(toUserA, assetIdA, toUserB, assetIdB, cBalAAfter, cBalBAfter, shareId)
796818 }
797819 else throw("Strict value is not equal to itself.")
798820 }
799821 else throw("Strict value is not equal to itself.")
800822 }
801823 else throw("Strict value is not equal to itself.")
802824 }
803825
804826
805827 func userCanWithdrawShareCalc (user,pool,posId,borrowed) = {
806828 let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position")
807829 let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest))
808830 let poolInterest = if (borrowed)
809831 then getIntegerValue(this, (pool + kPoolInterestLoan))
810832 else getIntegerValue(this, (pool + kPoolInterestNoLoan))
811833 (pAmount + fraction(pAmount, (poolInterest - userInterest), SCALE10))
812834 }
813835
814836
815837 func withdrawToUser (user,pool,posId,stopLoss) = {
816838 let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position")
817839 let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)), 0)
818840 let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0))
819841 let poolTotalShare = getPoolTotalShare(pool)
820842 let userAddr = Address(fromBase58String(user))
821843 let borrowAsset = valueOrElse(getString(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)), "")
822- let debt = if ((borrowAmount > 0))
823- then {
844+ let $t02661626850 = if ((borrowAmount > 0))
845+ then $Tuple2({
824846 let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posId), borrowAsset], nil)
825847 if ($isInstanceOf(@, "Int"))
826848 then @
827849 else throw(($getType(@) + " couldn't be cast to Int"))
828- }
850+ }, STOPLOSS_LOAN)
851+ else $Tuple2(0, STOPLOSS_FEE_NO_LOAN)
852+ let debt = $t02661626850._1
853+ let feeType = $t02661626850._2
854+ let stopLossFee = if (stopLoss)
855+ then fraction(userCanWithdraw, getAxlyFee(pool, feeType), FEE_SCALE6)
829856 else 0
830- let $t02638526538 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset)
831- if (($t02638526538 == $t02638526538))
857+ let $t02696727147 = withdrawAmountCalc(pool, (userCanWithdraw - stopLossFee), debt, borrowAsset, stopLossFee)
858+ if (($t02696727147 == $t02696727147))
832859 then {
833- let shareId = $t02638526538._7
834- let cBalBAfter = $t02638526538._6
835- let cBalAAfter = $t02638526538._5
836- let assetIdB = $t02638526538._4
837- let toUserAmountB = $t02638526538._3
838- let assetIdA = $t02638526538._2
839- let toUserAmountA = $t02638526538._1
860+ let shareId = $t02696727147._7
861+ let cBalBAfter = $t02696727147._6
862+ let cBalAAfter = $t02696727147._5
863+ let assetIdB = $t02696727147._4
864+ let toUserAmountB = $t02696727147._3
865+ let assetIdA = $t02696727147._2
866+ let toUserAmountA = $t02696727147._1
840867 let closeDbtInv = if ((debt > 0))
841868 then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)])
842869 else 0
843870 if ((closeDbtInv == closeDbtInv))
844- then ([DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, toUserAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, toUserAmountB, assetIdFromStr(assetIdB))] ++ getCursEntries(assetIdA, assetIdB, shareId, nil))
871+ then ([DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), ((poolTotalShare - userCanWithdraw) - stopLossFee)), ScriptTransfer(userAddr, toUserAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, toUserAmountB, assetIdFromStr(assetIdB)), ScriptTransfer(moneyBox, stopLossFee, fromBase58String(shareId))] ++ getCursEntries(assetIdA, assetIdB, shareId, nil))
845872 else throw("Strict value is not equal to itself.")
846873 }
847874 else throw("Strict value is not equal to itself.")
848875 }
849876
850877
851878 func parseRequest (requestId) = {
852879 let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",")
853880 let user = request[0]
854881 let pool = request[1]
855882 let pmtA = parseIntValue(request[2])
856883 let AId = request[3]
857884 let pmtB = parseIntValue(request[4])
858885 let BId = request[5]
859886 let balA = parseIntValue(request[6])
860887 let balB = parseIntValue(request[7])
861888 let shareId = request[8]
862889 let bwAsset = request[9]
863890 let bwAmount = parseIntValue(request[10])
864891 $Tuple11(user, pool, pmtA, AId, pmtB, BId, balA, balB, shareId, bwAsset, bwAmount)
865892 }
866893
867894
868895 func calcBorrowAmount (pmtA,pmtB,aId,bId,leverage,borrowId) = {
869896 let dPriceA = getIntegerValue(priceOracleAddr, (aId + kPriceInOracle))
870897 let dPriceB = getIntegerValue(priceOracleAddr, (bId + kPriceInOracle))
871898 let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN)
872899 let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN)
873900 let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB))
874- let $t02818228279 = if ((borrowId == aId))
901+ let $t02887628973 = if ((borrowId == aId))
875902 then $Tuple2(dPriceA, decPrA)
876903 else $Tuple2(dPriceB, decPrB)
877- let borrowPrice = $t02818228279._1
878- let borrowDecPr = $t02818228279._2
904+ let borrowPrice = $t02887628973._1
905+ let borrowDecPr = $t02887628973._2
879906 fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice)
880907 }
881908
882909
883910 func parseReplenishPmts (pmts,AId,BId) = if ((size(pmts) == 2))
884911 then if ((assetIdToStr(pmts[0].assetId) != AId))
885912 then throw("Wrong payment asset A")
886913 else if ((assetIdToStr(pmts[1].assetId) != BId))
887914 then throw("Wrong payment asset B")
888915 else $Tuple4(pmts[0].amount, AId, pmts[1].amount, BId)
889916 else if ((size(pmts) == 1))
890917 then if ((assetIdToStr(pmts[0].assetId) == AId))
891918 then $Tuple4(pmts[0].amount, AId, 0, BId)
892919 else if ((assetIdToStr(pmts[0].assetId) == BId))
893920 then $Tuple4(0, AId, pmts[0].amount, BId)
894921 else throw("Wrong payment")
895922 else throw("One or two payments expected")
896923
897924
898925 func calcPriceImpact (balA,balB,newBalA,newBalB) = {
899926 let pri = ((SCALE8 - fraction(fraction(balB, SCALE8, balA), SCALE8, fraction(newBalB, SCALE8, newBalA))) * 100)
900927 if ((0 > pri))
901928 then (pri * -1)
902929 else pri
903930 }
904931
905932
906933 @Callable(i)
907934 func getShareAssetPriceREADONLY (shareId) = {
908935 let sharePrices = getSharePrice(shareId)
909936 $Tuple2(nil, sharePrices)
910937 }
911938
912939
913940
914941 @Callable(i)
915942 func getUserPositionShareAmountREADONLY (user,posNum) = {
916943 let pool = valueOrErrorMessage(getString(this, (((user + "_") + posNum) + kUserPositionPool)), "Unknown position")
917944 let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posNum) + kUserBorrowAmount))
918945 let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum, (borrowAmount > 0))
919946 $Tuple2(nil, userCanWithdraw)
920947 }
921948
922949
923950
924951 @Callable(i)
925952 func getUserPositionInDollarsREADONLY (user,pools,posNum) = {
926953 func userPos (a,pool) = {
927- let $t02997830012 = a
928- let totalPos = $t02997830012._1
929- let posDebt = $t02997830012._2
930- let index = $t02997830012._3
954+ let $t03067230706 = a
955+ let totalPos = $t03067230706._1
956+ let posDebt = $t03067230706._2
957+ let index = $t03067230706._3
931958 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
932- let $t03010430194 = getPoolData(Address(fromBase58String(pool)), pType)
933- let AId = $t03010430194._1
934- let BId = $t03010430194._2
935- let balA = $t03010430194._3
936- let balB = $t03010430194._4
937- let shareId = $t03010430194._5
959+ let $t03079830888 = getPoolData(Address(fromBase58String(pool)), pType)
960+ let AId = $t03079830888._1
961+ let BId = $t03079830888._2
962+ let balA = $t03079830888._3
963+ let balB = $t03079830888._4
964+ let shareId = $t03079830888._5
938965 let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0)
939966 let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0))
940967 let sharePrices = getSharePrice(shareId)
941968 let decPrShare = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN)
942969 let shareD = fraction(userCanWithdraw, sharePrices, decPrShare)
943970 if ((borrowAmount == 0))
944971 then $Tuple3((totalPos :+ shareD), (posDebt :+ 0), (index + 1))
945972 else {
946973 let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAssetId))
947974 let debt = {
948975 let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posNum[index]), borrowAsset], nil)
949976 if ($isInstanceOf(@, "Int"))
950977 then @
951978 else throw(($getType(@) + " couldn't be cast to Int"))
952979 }
953980 let borrowAssetPrice = getIntegerValue(priceOracleAddr, (borrowAsset + kPriceInOracle))
954981 let decPrBorrowId = pow(10, 0, getAssetDecimals(borrowAsset), 0, 0, DOWN)
955982 let debtD = fraction(debt, borrowAssetPrice, decPrBorrowId)
956983 $Tuple3((totalPos :+ shareD), (posDebt :+ debtD), (index + 1))
957984 }
958985 }
959986
960- let $t03121431269 = {
987+ let $t03190831963 = {
961988 let $l = pools
962989 let $s = size($l)
963990 let $acc0 = $Tuple3(nil, nil, 0)
964991 func $f0_1 ($a,$i) = if (($i >= $s))
965992 then $a
966993 else userPos($a, $l[$i])
967994
968995 func $f0_2 ($a,$i) = if (($i >= $s))
969996 then $a
970997 else throw("List size exceeds 20")
971998
972999 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
9731000 }
974- let pos = $t03121431269._1
975- let debt = $t03121431269._2
1001+ let pos = $t03190831963._1
1002+ let debt = $t03190831963._2
9761003 $Tuple2(nil, $Tuple2(pos, debt))
9771004 }
9781005
9791006
9801007
9811008 @Callable(i)
9821009 func replenish (pool,leverage,borrowId) = if (if ((100 > leverage))
9831010 then true
9841011 else (leverage > 300))
9851012 then throw("Leverage can't be <100 and >300")
9861013 else if (if (!(getBooleanValue(this, (pool + kPoolCanBorrow))))
9871014 then (leverage > 100)
9881015 else false)
9891016 then throw("You can't borrow in this pool")
9901017 else {
9911018 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
992- let $t03170931799 = getPoolData(Address(fromBase58String(pool)), pType)
993- let AId = $t03170931799._1
994- let BId = $t03170931799._2
995- let balA = $t03170931799._3
996- let balB = $t03170931799._4
997- let shareId = $t03170931799._5
998- let $t03180231883 = parseReplenishPmts(i.payments, AId, BId)
999- let pmtA = $t03180231883._1
1000- let pmtAssetA = $t03180231883._2
1001- let pmtB = $t03180231883._3
1002- let pmtAssetB = $t03180231883._4
1019+ let $t03240332493 = getPoolData(Address(fromBase58String(pool)), pType)
1020+ let AId = $t03240332493._1
1021+ let BId = $t03240332493._2
1022+ let balA = $t03240332493._3
1023+ let balB = $t03240332493._4
1024+ let shareId = $t03240332493._5
1025+ let $t03249632577 = parseReplenishPmts(i.payments, AId, BId)
1026+ let pmtA = $t03249632577._1
1027+ let pmtAssetA = $t03249632577._2
1028+ let pmtB = $t03249632577._3
1029+ let pmtAssetB = $t03249632577._4
10031030 let user = toString(i.caller)
10041031 let newPosNum = getNewUserPositionNumber(user)
10051032 if ((leverage > 100))
10061033 then {
10071034 let borrowAmount = calcBorrowAmount(pmtA, pmtB, pmtAssetA, pmtAssetB, leverage, borrowId)
10081035 let request = makeString([user, pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowId, toString(borrowAmount)], ",")
10091036 let newRequestId = {
10101037 let @ = invoke(this, "createNewRequest", [request], nil)
10111038 if ($isInstanceOf(@, "Int"))
10121039 then @
10131040 else throw(($getType(@) + " couldn't be cast to Int"))
10141041 }
10151042 if ((newRequestId == newRequestId))
10161043 then {
10171044 let args = [((user + "_") + toString(newPosNum)), shareId, borrowId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))]
10181045 let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil)
10191046 if ((inv == inv))
10201047 then {
10211048 let userStaked = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPosition))
1022- let $t03289632990 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId)
1023- if (($t03289632990 == $t03289632990))
1049+ let $t03359033684 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId)
1050+ if (($t03359033684 == $t03359033684))
10241051 then {
1025- let newBalB = $t03289632990._2
1026- let newBalA = $t03289632990._1
1052+ let newBalB = $t03359033684._2
1053+ let newBalA = $t03359033684._1
10271054 let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB)
1028- let $t03306033175 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1029- let wAmountA = $t03306033175._1
1030- let wAmountB = $t03306033175._2
1055+ let $t03375433869 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1056+ let wAmountA = $t03375433869._1
1057+ let wAmountB = $t03375433869._2
10311058 $Tuple2(nil, [prImpact, wAmountA, wAmountB])
10321059 }
10331060 else throw("Strict value is not equal to itself.")
10341061 }
10351062 else throw("Strict value is not equal to itself.")
10361063 }
10371064 else throw("Strict value is not equal to itself.")
10381065 }
10391066 else {
1040- let $t03322833340 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1041- let userStaked = $t03322833340._1
1042- let axlyFee = $t03322833340._2
1043- let $t03334633440 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId)
1044- if (($t03334633440 == $t03334633440))
1067+ let $t03392234034 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1068+ let userStaked = $t03392234034._1
1069+ let axlyFee = $t03392234034._2
1070+ let $t03404034134 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId)
1071+ if (($t03404034134 == $t03404034134))
10451072 then {
1046- let newBalB = $t03334633440._2
1047- let newBalA = $t03334633440._1
1073+ let newBalB = $t03404034134._2
1074+ let newBalA = $t03404034134._1
10481075 let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB)
1049- let $t03351033625 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1050- let wAmountA = $t03351033625._1
1051- let wAmountB = $t03351033625._2
1076+ let $t03420434319 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1077+ let wAmountA = $t03420434319._1
1078+ let wAmountB = $t03420434319._2
10521079 $Tuple2((replenishEntries(pool, user, userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])), [prImpact, wAmountA, wAmountB])
10531080 }
10541081 else throw("Strict value is not equal to itself.")
10551082 }
10561083 }
10571084
10581085
10591086
10601087 @Callable(i)
10611088 func withdraw (pool,posId) = withdrawToUser(toString(i.caller), pool, toString(posId), false)
10621089
10631090
10641091
10651092 @Callable(i)
10661093 func createUpdateStopLoss (posId,poolId,assetId,price) = {
10671094 let tokenOraclePrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle))
10681095 if (!(isDefined(getInteger(this, (((((poolId + "_") + toString(i.caller)) + "_") + toString(posId)) + kUserPosition)))))
10691096 then throw("There are no user position")
10701097 else if ((0 >= price))
10711098 then throw("Price must be greater than 0")
10721099 else if ((price > tokenOraclePrice))
10731100 then throw("Price must be less than current token price")
10741101 else [IntegerEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss), price)]
10751102 }
10761103
10771104
10781105
10791106 @Callable(i)
10801107 func deleteStopLoss (posId,poolId,assetId) = if (!(isDefined(getInteger(this, (((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss)))))
10811108 then throw("No entry")
10821109 else [DeleteEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))]
10831110
10841111
10851112
10861113 @Callable(i)
10871114 func init (moneyBoxAddr,sfFarmingAddr,lendAddr,priceOracleAddr,keeperExContract,wxSwapContract,swopAssetId,wxAssetId,adminPubKey) = if (isDefined(getString(kMoneyBox)))
10881115 then throw("Already inited")
10891116 else [StringEntry(kMoneyBox, moneyBoxAddr), StringEntry(kSFFarmingAddr, sfFarmingAddr), StringEntry(kLendService, lendAddr), StringEntry(kPriceOracle, priceOracleAddr), StringEntry(kExContract, keeperExContract), StringEntry(kWxSwapContract, wxSwapContract), StringEntry(kSwopId, swopAssetId), StringEntry(kWxId, wxAssetId), StringEntry(kAdminCallPK, adminPubKey)]
10901117
10911118
10921119
10931120 @Callable(i)
10941121 func createNewRequest (params) = valueOrElse(isSelfCall(i), {
10951122 let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1)
10961123 $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId)
10971124 })
10981125
10991126
11001127
11011128 @Callable(i)
11021129 func replenishFromLand (requestId) = valueOrElse(isLandCall(i), {
1103- let $t03615136255 = parseRequest(requestId)
1104- let user = $t03615136255._1
1105- let pool = $t03615136255._2
1106- let pmtA = $t03615136255._3
1107- let AId = $t03615136255._4
1108- let pmtB = $t03615136255._5
1109- let BId = $t03615136255._6
1110- let balA = $t03615136255._7
1111- let balB = $t03615136255._8
1112- let shareId = $t03615136255._9
1113- let bwAsset = $t03615136255._10
1114- let bwAmount = $t03615136255._11
1130+ let $t03684536949 = parseRequest(requestId)
1131+ let user = $t03684536949._1
1132+ let pool = $t03684536949._2
1133+ let pmtA = $t03684536949._3
1134+ let AId = $t03684536949._4
1135+ let pmtB = $t03684536949._5
1136+ let BId = $t03684536949._6
1137+ let balA = $t03684536949._7
1138+ let balB = $t03684536949._8
1139+ let shareId = $t03684536949._9
1140+ let bwAsset = $t03684536949._10
1141+ let bwAmount = $t03684536949._11
11151142 if ((size(i.payments) != 1))
11161143 then throw("Wrong payment size")
11171144 else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset))
11181145 then true
11191146 else (i.payments[0].amount != bwAmount))
11201147 then throw("Wrong payment")
11211148 else {
1122- let $t03644536569 = if ((AId == bwAsset))
1149+ let $t03713937263 = if ((AId == bwAsset))
11231150 then $Tuple2((pmtA + i.payments[0].amount), pmtB)
11241151 else $Tuple2(pmtA, (pmtB + i.payments[0].amount))
1125- let pmtAllA = $t03644536569._1
1126- let pmtAllB = $t03644536569._2
1152+ let pmtAllA = $t03713937263._1
1153+ let pmtAllB = $t03713937263._2
11271154 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool")
1128- let $t03665136766 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId)
1129- let userStaked = $t03665136766._1
1130- let axlyFee = $t03665136766._2
1155+ let $t03734537460 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId)
1156+ let userStaked = $t03734537460._1
1157+ let axlyFee = $t03734537460._2
11311158 let posNum = getNewUserPositionNumber(user)
11321159 let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)]
11331160 let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true)
1134- let $t03712637241 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1135- let wAmountA = $t03712637241._1
1136- let wAmountB = $t03712637241._2
1161+ let $t03782037935 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked)
1162+ let wAmountA = $t03782037935._1
1163+ let wAmountB = $t03782037935._2
11371164 $Tuple2((((entries ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked)
11381165 }
11391166 })
11401167
11411168
11421169
11431170 @Callable(i)
11441171 func liquidate (user,posId,liquidateAmount) = valueOrElse(isLandCall(i), {
11451172 let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position")
11461173 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
1147- let $t03773637826 = getPoolData(Address(fromBase58String(pool)), pType)
1148- let AId = $t03773637826._1
1149- let BId = $t03773637826._2
1150- let balA = $t03773637826._3
1151- let balB = $t03773637826._4
1152- let shareId = $t03773637826._5
1174+ let $t03843038520 = getPoolData(Address(fromBase58String(pool)), pType)
1175+ let AId = $t03843038520._1
1176+ let BId = $t03843038520._2
1177+ let balA = $t03843038520._3
1178+ let balB = $t03843038520._4
1179+ let shareId = $t03843038520._5
11531180 let amount = unstakeLP(pool, pType, shareId, liquidateAmount)
11541181 let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount))
11551182 let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId))
11561183 let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0))
1157- if ((borrowAmount == 0))
1158- then throw("You can't liquidate position without borrow")
1159- else [IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest), getIntegerValue(this, (pool + kPoolInterestLoan))), IntegerEntry((pool + kPoolTotalLoan), (getPoolTotalShareWithLoan(pool) - liquidateAmount)), IntegerEntry((pool + kPoolTotal), (getPoolTotalShare(pool) - liquidateAmount)), IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition), (userCanWithdraw - liquidateAmount)), ScriptTransfer(i.caller, amount, fromBase58String(shareId))]
1184+ if ((liquidateAmount > userCanWithdraw))
1185+ then throw("You can't liquidate more than user have")
1186+ else if ((borrowAmount == 0))
1187+ then throw("You can't liquidate position without borrow")
1188+ else [IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest), getIntegerValue(this, (pool + kPoolInterestLoan))), IntegerEntry((pool + kPoolTotalLoan), (getPoolTotalShareWithLoan(pool) - liquidateAmount)), IntegerEntry((pool + kPoolTotal), (getPoolTotalShare(pool) - liquidateAmount)), IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition), (userCanWithdraw - liquidateAmount)), ScriptTransfer(i.caller, amount, fromBase58String(shareId))]
11601189 })
11611190
11621191
11631192
11641193 @Callable(i)
11651194 func stopLoss (user,posId,pool,assetId) = valueOrElse(isAdminCall(i), {
11661195 let tokenOraclePrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle))
1167- if (!(isDefined(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)))))
1168- then throw("No entry")
1169- else (withdrawToUser(toString(i.caller), pool, toString(posId), true) :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)))
1196+ if ((tokenOraclePrice > tokenOraclePrice))
1197+ then throw("Token price greater stop loss price")
1198+ else if (!(isDefined(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)))))
1199+ then throw("No entry")
1200+ else (withdrawToUser(user, pool, toString(posId), true) :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)))
11701201 })
11711202
11721203
11731204
11741205 @Callable(i)
11751206 func capitalizeExKeeper (pool,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = valueOrElse(isAdminCall(i), {
1176- let type = getStringValue(this, (kPool + pool))
1177- let $t03961939813 = if (claim)
1178- then claimFarmed(type, pool)
1207+ let pType = getStringValue(this, (kPool + pool))
1208+ let $t04049340784 = if (claim)
1209+ then claimFarmed(pType, pool)
11791210 else {
1180- let claimedAsset = if ((type == SF_POOL))
1211+ let claimedAsset = if ((pType == SF_POOL))
11811212 then SWOPID
1182- else WXID
1213+ else if ((pType == WX_POOL))
1214+ then WXID
1215+ else unknownPoolType()
11831216 $Tuple2(amountToExchange, claimedAsset)
11841217 }
1185- let claimedAmount = $t03961939813._1
1186- let claimedAsset = $t03961939813._2
1218+ let claimedAmount = $t04049340784._1
1219+ let claimedAsset = $t04049340784._2
11871220 let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options)
11881221 let change = (claimedAmount - amountToExchange)
11891222 let changeEntry = if ((change > 0))
11901223 then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))]
11911224 else nil
1192- (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry)
1225+ (capitalize(pool, pType, tokenToId, exchangedAmount) ++ changeEntry)
11931226 })
11941227
11951228
11961229
11971230 @Callable(i)
11981231 func capitalizeExPuzzle (pool,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = valueOrElse(isAdminCall(i), {
1199- let type = getStringValue(this, (kPool + pool))
1200- let $t04052840722 = if (claim)
1201- then claimFarmed(type, pool)
1232+ let pType = getStringValue(this, (kPool + pool))
1233+ let $t04150141792 = if (claim)
1234+ then claimFarmed(pType, pool)
12021235 else {
1203- let claimedAsset = if ((type == SF_POOL))
1236+ let claimedAsset = if ((pType == SF_POOL))
12041237 then SWOPID
1205- else WXID
1238+ else if ((pType == WX_POOL))
1239+ then WXID
1240+ else unknownPoolType()
12061241 $Tuple2(amountToExchange, claimedAsset)
12071242 }
1208- let claimedAmount = $t04052840722._1
1209- let claimedAsset = $t04052840722._2
1243+ let claimedAmount = $t04150141792._1
1244+ let claimedAsset = $t04150141792._2
12101245 let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options)
12111246 let change = (claimedAmount - amountToExchange)
12121247 let changeEntry = if ((change > 0))
12131248 then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))]
12141249 else nil
1215- (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry)
1250+ (capitalize(pool, pType, tokenToId, exchangedAmount) ++ changeEntry)
12161251 })
12171252
12181253
12191254
12201255 @Callable(i)
12211256 func capitalizeExSwopFi (pool,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = valueOrElse(isAdminCall(i), {
1222- let type = getStringValue(this, (kPool + pool))
1223- let $t04150441698 = if (claim)
1224- then claimFarmed(type, pool)
1257+ let pType = getStringValue(this, (kPool + pool))
1258+ let $t04257642867 = if (claim)
1259+ then claimFarmed(pType, pool)
12251260 else {
1226- let claimedAsset = if ((type == SF_POOL))
1261+ let claimedAsset = if ((pType == SF_POOL))
12271262 then SWOPID
1228- else WXID
1263+ else if ((pType == WX_POOL))
1264+ then WXID
1265+ else unknownPoolType()
12291266 $Tuple2(amountToExchange, claimedAsset)
12301267 }
1231- let claimedAmount = $t04150441698._1
1232- let claimedAsset = $t04150441698._2
1268+ let claimedAmount = $t04257642867._1
1269+ let claimedAsset = $t04257642867._2
12331270 let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options)
12341271 let change = (claimedAmount - amountToExchange)
12351272 let changeEntry = if ((change > 0))
12361273 then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))]
12371274 else nil
1238- (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry)
1275+ (capitalize(pool, pType, tokenToId, exchangedAmount) ++ changeEntry)
12391276 })
12401277
12411278
12421279
12431280 @Callable(i)
12441281 func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan,stoplossFeeNoLoan,stoplossFeeWithLoan,canBorrow) = valueOrElse(isAdminCall(i), if (if ((type != SF_POOL))
12451282 then (type != WX_POOL)
12461283 else false)
12471284 then throw("Wrong type")
12481285 else {
1249- let $t04243942533 = getPoolData(Address(fromBase58String(poolAddr)), type)
1250- let aId = $t04243942533._1
1251- let bId = $t04243942533._2
1252- let aBal = $t04243942533._3
1253- let bBal = $t04243942533._4
1254- let shareId = $t04243942533._5
1286+ let $t04360943703 = getPoolData(Address(fromBase58String(poolAddr)), type)
1287+ let aId = $t04360943703._1
1288+ let bId = $t04360943703._2
1289+ let aBal = $t04360943703._3
1290+ let bBal = $t04360943703._4
1291+ let shareId = $t04360943703._5
12551292 [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kAxlyStopLossNoLoanFee), stoplossFeeNoLoan), IntegerEntry((poolAddr + kAxlyStopLossLoanFee), stoplossFeeWithLoan), IntegerEntry((poolAddr + kPoolInterestLoan), 0), IntegerEntry((poolAddr + kPoolInterestNoLoan), 0), StringEntry((kPool + poolAddr), type), StringEntry((shareId + kSharePool), poolAddr), BooleanEntry((poolAddr + kPoolCanBorrow), canBorrow)]
12561293 })
12571294
12581295
12591296 @Verifier(tx)
12601297 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
12611298

github/deemru/w8io/026f985 
222.45 ms