tx · 3qpmxjEJDyLxnAnwC6JH8HkcoShp1w8USfxK2td5XV7c

3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS:  -0.04500000 Waves

2023.06.12 21:20 [2619806] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves

{ "type": 13, "id": "3qpmxjEJDyLxnAnwC6JH8HkcoShp1w8USfxK2td5XV7c", "fee": 4500000, "feeAssetId": null, "timestamp": 1686594050734, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "4sN4xyArxZQZyMePQGUuCQ39e1bMjGvdoQmXZcwTLFUUAjQwP6LrBqBvCsMMLhYRLhBuggvUmuq33XychwE3qcNL" ], "script": "base64:BgKYAQgCEgcKBQgBCAEBEgMKAQgSBAoCCAgSBQoDCBgYEgUKAwgBCBIDCgEIEgQKAggBEgYKBAEICAESBQoDAQgIEgMKAQgSBgoECAEICBIFCgMICAESDgoMCAgIAQQRGBgRAQEYEgoKCAgICAEECAEYEg4KDAgICAEEGBgYGBgBGBIKCggICAEBAQEBARIGCgQICAgBEgQKAggIYQAHU0ZfUE9PTAICU0YAB1dYX1BPT0wCAldYAA9DQVBfRkVFX05PX0xPQU4CCWNhcE5vTG9hbgAMQ0FQX0ZFRV9MT0FOAgdjYXBMb2FuABRTVE9QTE9TU19GRUVfTk9fTE9BTgIOc3RvcExvc3NOb0xvYW4ADVNUT1BMT1NTX0xPQU4CDHN0b3BMb3NzTG9hbgAITE9BTl9GRUUCBGxvYW4AC05PX0xPQU5fRkVFAgZub0xvYW4ABk5PX0ZFRQIFbm9GZWUABlNDQUxFOACAwtcvAAdTQ0FMRTEwAIDIr6AlAApGRUVfU0NBTEU2AMCEPQAUa1NGUG9vbEFBc3NldEJhbGFuY2UCD0FfYXNzZXRfYmFsYW5jZQAUa1NG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CUW7drw Next: AyhzvFQeNbLSeaLq5z1UEcTGbpMRYAba7CrywXMMaqQo Diff:
OldNewDifferences
273273
274274 func $f0_2 ($a,$i) = if (($i >= $s))
275275 then $a
276- else throw("List size exceeds 100")
276+ else throw("List size exceeds 50")
277277
278- $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($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), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100)
278+ $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)
279279 }
280280
281281
282-func getSharePrice (shareIds) = {
283- func getPrices (a,shareId) = {
284- let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id")
285- let poolAddr = Address(fromBase58String(pool))
286- let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
287- let $t084288493 = getPoolData(poolAddr, pType)
288- let aId = $t084288493._1
289- let bId = $t084288493._2
290- let aBalance = $t084288493._3
291- let bBalance = $t084288493._4
292- let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [aId, false], nil)
293- if ($isInstanceOf(@, "(Int, Int)"))
294- then @
295- else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2
296- let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [bId, false], nil)
297- if ($isInstanceOf(@, "(Int, Int)"))
298- then @
299- else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2
300- let shareSupply = getShareSupply(poolAddr, pType, shareId)
301- let APrecision = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN)
302- let BPrecision = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN)
303- let sharePrecision = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN)
304- let sum = (fraction(aBalance, dPriceA, APrecision) + fraction(bBalance, dPriceB, BPrecision))
305- let sharePrice = fraction(sum, sharePrecision, shareSupply)
306- (a :+ sharePrice)
307- }
282+func getSharePrice (shareId) = {
283+ let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id")
284+ let poolAddr = Address(fromBase58String(pool))
285+ let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
286+ let $t083618426 = getPoolData(poolAddr, pType)
287+ let aId = $t083618426._1
288+ let bId = $t083618426._2
289+ let aBalance = $t083618426._3
290+ let bBalance = $t083618426._4
291+ let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [aId, false], nil)
292+ if ($isInstanceOf(@, "(Int, Int)"))
293+ then @
294+ else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2
295+ let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [bId, false], nil)
296+ if ($isInstanceOf(@, "(Int, Int)"))
297+ then @
298+ else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2
299+ let shareSupply = getShareSupply(poolAddr, pType, shareId)
300+ let APrecision = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN)
301+ let BPrecision = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN)
302+ let sharePrecision = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN)
303+ let sum = (fraction(aBalance, dPriceA, APrecision) + fraction(bBalance, dPriceB, BPrecision))
304+ fraction(sum, sharePrecision, shareSupply)
305+ }
306+
307+
308+func getSharePrices (shareIds) = {
309+ func getPrices (a,shareId) = (a :+ getSharePrice(shareId))
308310
309311 let $l = shareIds
310312 let $s = size($l)
315317
316318 func $f0_2 ($a,$i) = if (($i >= $s))
317319 then $a
318- else throw("List size exceeds 50")
320+ else throw("List size exceeds 20")
319321
320- $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)
322+ $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)
321323 }
322324
323325
324326 func getCursEntries (aId,bId,shareId) = {
325327 let assetsPrices = getAssetsPrice([aId, bId])
326- let sharePrice = getSharePrice([shareId])
327- let prices = [toString(assetsPrices[0]), toString(assetsPrices[1]), toString(sharePrice[0])]
328+ let sharePrice = getSharePrice(shareId)
329+ let prices = [toString(assetsPrices[0]), toString(assetsPrices[1]), toString(sharePrice)]
328330 [StringEntry(kTokenLastPrice, makeString(prices, ","))]
329331 }
330332
331333
332334 func calcReplenishByTwoTokens (pType,poolAddr,pmtA,aId,pmtB,bId,balA,balB) = {
333- let $t096459950 = if ((pType == SF_POOL))
335+ let $t096549959 = if ((pType == SF_POOL))
334336 then $Tuple2(nil, nil)
335337 else $Tuple2(split({
336338 let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil)
343345 then @
344346 else throw(($getType(@) + " couldn't be cast to String"))
345347 }, "__"))
346- if (($t096459950 == $t096459950))
348+ if (($t096549959 == $t096549959))
347349 then {
348- let evalPutInB = $t096459950._2
349- let evalPutInA = $t096459950._1
350- let $t0996010156 = if ((pType == SF_POOL))
350+ let evalPutInB = $t096549959._2
351+ let evalPutInA = $t096549959._1
352+ let $t0996910165 = if ((pType == SF_POOL))
351353 then $Tuple2(fraction(SCALE8, pmtA, balA), fraction(SCALE8, pmtB, balB))
352354 else $Tuple2(parseIntValue(evalPutInA[1]), parseIntValue(evalPutInB[1]))
353- let ratioA = $t0996010156._1
354- let ratioB = $t0996010156._2
355- let $t01016210644 = if ((ratioB > ratioA))
355+ let ratioA = $t0996910165._1
356+ let ratioB = $t0996910165._2
357+ let $t01017110653 = if ((ratioB > ratioA))
356358 then {
357359 let pmt = if ((pType == SF_POOL))
358360 then fraction(balB, ratioA, SCALE8, CEILING)
365367 else parseIntValue(evalPutInB[7])
366368 $Tuple5(pmt, pmtB, (pmtA - pmt), aId, ratioA)
367369 }
368- let pmtInA = $t01016210644._1
369- let pmtInB = $t01016210644._2
370- let change = $t01016210644._3
371- let changeAssetId = $t01016210644._4
372- let lp = $t01016210644._5
370+ let pmtInA = $t01017110653._1
371+ let pmtInB = $t01017110653._2
372+ let change = $t01017110653._3
373+ let changeAssetId = $t01017110653._4
374+ let lp = $t01017110653._5
373375 $Tuple5(pmtInA, pmtInB, change, changeAssetId, lp)
374376 }
375377 else throw("Strict value is not equal to itself.")
401403
402404
403405 func unstakeLP (pool,pType,shareId,amount) = {
404- let $t01187412231 = if ((pType == SF_POOL))
406+ let $t01188312240 = if ((pType == SF_POOL))
405407 then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount])
406408 else if ((pType == WX_POOL))
407409 then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount])
408410 else throw("Wrong pool type")
409- let farmAddr = $t01187412231._1
410- let fName = $t01187412231._2
411- let params = $t01187412231._3
411+ let farmAddr = $t01188312240._1
412+ let fName = $t01188312240._2
413+ let params = $t01188312240._3
412414 let inv = invoke(farmAddr, fName, params, nil)
413415 if ((inv == inv))
414416 then amount
421423 let feeScale6 = 1000000
422424 let fee = getIntegerValue(poolAddr, kSFPoolFee)
423425 let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee))
424- let $t01264412932 = if ((assetTokenToGet == assetIdA))
426+ let $t01265312941 = if ((assetTokenToGet == assetIdA))
425427 then {
426428 let amountToPay = fraction(balA, amntGetNoFee, (balB - amntGetNoFee))
427429 $Tuple2(amountToPay, assetIdB)
430432 let amountToPay = fraction(balB, amntGetNoFee, (balA - amntGetNoFee))
431433 $Tuple2(amountToPay, assetIdA)
432434 }
433- let amountToPay = $t01264412932._1
434- let assetToPay = $t01264412932._2
435+ let amountToPay = $t01265312941._1
436+ let assetToPay = $t01265312941._2
435437 $Tuple2(assetToPay, amountToPay)
436438 }
437439
440442 let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee")
441443 let pFee = getIntegerValue(wxSwapContract, "%s__poolFee")
442444 let feeScale = toBigInt(100000000)
443- let $t01327113579 = if ((assetTokenToGet == assetIdA))
445+ let $t01328013588 = if ((assetTokenToGet == assetIdA))
444446 then {
445447 let amountToPay = fraction(balA, amountTokenToGet, (balB - amountTokenToGet))
446448 $Tuple2(amountToPay, assetIdB)
449451 let amountToPay = fraction(balB, amountTokenToGet, (balA - amountTokenToGet))
450452 $Tuple2(amountToPay, assetIdA)
451453 }
452- let amountToPay = $t01327113579._1
453- let assetToPay = $t01327113579._2
454+ let amountToPay = $t01328013588._1
455+ let assetToPay = $t01328013588._2
454456 let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee)))))
455457 $Tuple2(assetToPay, amountToPayWithFee)
456458 }
458460
459461 func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL))
460462 then {
461- let $t01391714039 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
462- let assetToPay = $t01391714039._1
463- let amountToPay = $t01391714039._2
463+ let $t01392614048 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
464+ let assetToPay = $t01392614048._1
465+ let amountToPay = $t01392614048._2
464466 invoke(addressFromStringValue(pool), "callFunction", ["exchange", ["1"]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)])
465467 }
466468 else {
467- let $t01419014312 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
468- let assetToPay = $t01419014312._1
469- let amountToPay = $t01419014312._2
469+ let $t01419914321 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
470+ let assetToPay = $t01419914321._1
471+ let amountToPay = $t01419914321._2
470472 invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)])
471473 }
472474
492494 }
493495 else if ((pType == WX_POOL))
494496 then {
495- let $t01487715218 = if (if ((pmtA > 0))
497+ let $t01488615227 = if (if ((pmtA > 0))
496498 then (pmtB > 0)
497499 else false)
498500 then {
499- let $t01495815084 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
500- let pmtInA = $t01495815084._1
501- let pmtInB = $t01495815084._2
502- let change = $t01495815084._3
503- let changeId = $t01495815084._4
504- let lpAmount = $t01495815084._5
501+ let $t01496715093 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
502+ let pmtInA = $t01496715093._1
503+ let pmtInB = $t01496715093._2
504+ let change = $t01496715093._3
505+ let changeId = $t01496715093._4
506+ let lpAmount = $t01496715093._5
505507 $Tuple3(change, changeId, lpAmount)
506508 }
507509 else if ((pmtA > 0))
508510 then $Tuple3(pmtA, aId, 0)
509511 else $Tuple3(pmtB, bId, 0)
510- let change = $t01487715218._1
511- let changeId = $t01487715218._2
512- let lpTwo = $t01487715218._3
512+ let change = $t01488615227._1
513+ let changeId = $t01488615227._2
514+ let lpTwo = $t01488615227._3
513515 let lpOne = if ((change > 0))
514516 then {
515517 let inv = {
531533
532534 func calcWithdrawLPVirt (pType,pool,lpAmount,shareId,aId,bId,balA,balB,borrowAmount,borrowAssetId) = {
533535 let poolAddr = addressFromStringValue(pool)
534- let $t01570416170 = if ((pType == SF_POOL))
536+ let $t01571316179 = if ((pType == SF_POOL))
535537 then {
536538 let inv = {
537539 let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(lpAmount)]], nil)
566568 else throw("Strict value is not equal to itself.")
567569 }
568570 else throw("Wrong pool type")
569- let getAmountA = $t01570416170._1
570- let getAmountB = $t01570416170._2
571+ let getAmountA = $t01571316179._1
572+ let getAmountB = $t01571316179._2
571573 if ((borrowAmount > 0))
572574 then {
573575 let amountToGetEx = if (if ((borrowAssetId == aId))
579581 else false)
580582 then (borrowAmount - getAmountB)
581583 else 0
582- let $t01647316788 = if ((amountToGetEx > 0))
584+ let $t01648216797 = if ((amountToGetEx > 0))
583585 then if ((pType == SF_POOL))
584586 then calcAmountToPaySF(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId)
585587 else calcAmountToPayWX(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId)
586588 else $Tuple2("", 0)
587- let assetToPay = $t01647316788._1
588- let amountToPay = $t01647316788._2
589+ let assetToPay = $t01648216797._1
590+ let amountToPay = $t01648216797._2
589591 if ((borrowAssetId == aId))
590592 then $Tuple2(((getAmountA + amountToGetEx) - borrowAmount), (getAmountB - amountToPay))
591593 else $Tuple2((getAmountA - amountToPay), ((getAmountB + amountToGetEx) - borrowAmount))
632634 if ((lpBalanceBefore == lpBalanceBefore))
633635 then {
634636 let poolAddr = addressFromStringValue(pool)
635- let $t01799718413 = if (if ((pmtA > 0))
637+ let $t01800618422 = if (if ((pmtA > 0))
636638 then (pmtB > 0)
637639 else false)
638640 then {
639- let $t01806318179 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
640- let pmtInA = $t01806318179._1
641- let pmtInB = $t01806318179._2
642- let change = $t01806318179._3
643- let changeId = $t01806318179._4
641+ let $t01807218188 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
642+ let pmtInA = $t01807218188._1
643+ let pmtInB = $t01807218188._2
644+ let change = $t01807218188._3
645+ let changeId = $t01807218188._4
644646 let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId)
645647 if ((inv == inv))
646648 then $Tuple2(change, changeId)
651653 else if ((pmtB > 0))
652654 then $Tuple2(pmtB, bId)
653655 else throw("pmts must be > 0")
654- let change = $t01799718413._1
655- let changeId = $t01799718413._2
656+ let change = $t01800618422._1
657+ let changeId = $t01800618422._2
656658 let inv = if ((change > 0))
657659 then replenishOneTokenByType(poolAddr, pType, change, changeId)
658660 else nil
680682 func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = {
681683 let totalAmount = getPoolTotalShare(pool)
682684 let totalAmountLoan = getPoolTotalShareWithLoan(pool)
683- let $t01927119509 = if (withLoan)
685+ let $t01928019518 = if (withLoan)
684686 then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount))
685687 else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan)
686- let curPoolInterest = $t01927119509._1
687- let totalStakedWithLoan = $t01927119509._2
688+ let curPoolInterest = $t01928019518._1
689+ let totalStakedWithLoan = $t01928019518._2
688690 [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))]
689691 }
690692
730732
731733 func capitalize (pool,pType,tokenId,tokenAmount) = {
732734 let poolAddr = Address(fromBase58String(pool))
733- let $t02186021939 = getPoolData(poolAddr, pType)
734- let AId = $t02186021939._1
735- let BId = $t02186021939._2
736- let balA = $t02186021939._3
737- let balB = $t02186021939._4
738- let shareId = $t02186021939._5
739- let $t02194222022 = if ((tokenId == AId))
740- then $Tuple2(tokenAmount, 0)
741- else $Tuple2(0, tokenAmount)
742- let pmtA = $t02194222022._1
743- let pmtB = $t02194222022._2
744- let $t02202522129 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
745- let stakedAmount = $t02202522129._1
746- let nf = $t02202522129._2
747- let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0)
748- let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0)
749- let totalShareAmount = getPoolTotalShare(pool)
750- let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool)
751- let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount)
752- let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8)
753- let stakedNoLoan = (stakedAmount - stakedLoan)
754- let newInterestLoan = if ((totalShareAmountWithLoan > 0))
755- then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan))
756- else 0
757- let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0))
758- then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan)))
759- else 0
760- let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6)
761- let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6)
762- let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan))
763- if ((axlyFee == axlyFee))
764- 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))
765- else throw("Strict value is not equal to itself.")
735+ let $t02186921935 = getPoolData(poolAddr, pType)
736+ let AId = $t02186921935._1
737+ let BId = $t02186921935._2
738+ let balA = $t02186921935._3
739+ let balB = $t02186921935._4
740+ let shareId = $t02186921935._5
741+ if (if ((tokenId != AId))
742+ then (tokenId != BId)
743+ else false)
744+ then throw("Wrong asset")
745+ else {
746+ let $t02202022100 = if ((tokenId == AId))
747+ then $Tuple2(tokenAmount, 0)
748+ else $Tuple2(0, tokenAmount)
749+ let pmtA = $t02202022100._1
750+ let pmtB = $t02202022100._2
751+ let $t02210322207 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
752+ let stakedAmount = $t02210322207._1
753+ let nf = $t02210322207._2
754+ let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0)
755+ let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0)
756+ let totalShareAmount = getPoolTotalShare(pool)
757+ let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool)
758+ let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount)
759+ let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8)
760+ let stakedNoLoan = (stakedAmount - stakedLoan)
761+ let newInterestLoan = if ((totalShareAmountWithLoan > 0))
762+ then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan))
763+ else 0
764+ let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0))
765+ then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan)))
766+ else 0
767+ let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6)
768+ let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6)
769+ let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan))
770+ if ((axlyFee == axlyFee))
771+ 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))
772+ else throw("Strict value is not equal to itself.")
773+ }
766774 }
767775
768776
769777 func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = {
770778 let poolAddr = Address(fromBase58String(pool))
771779 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool")
772- let $t02389723973 = getPoolData(poolAddr, pType)
773- let assetIdA = $t02389723973._1
774- let assetIdB = $t02389723973._2
775- let balA = $t02389723973._3
776- let balB = $t02389723973._4
777- let shareId = $t02389723973._5
780+ let $t02397524051 = getPoolData(poolAddr, pType)
781+ let assetIdA = $t02397524051._1
782+ let assetIdB = $t02397524051._2
783+ let balA = $t02397524051._3
784+ let balB = $t02397524051._4
785+ let shareId = $t02397524051._5
778786 let cBalABefore = accountBalance(assetIdFromStr(assetIdA))
779787 if ((cBalABefore == cBalABefore))
780788 then {
793801 then {
794802 let cBalAAfter = accountBalance(assetIdFromStr(assetIdA))
795803 let cBalBAfter = accountBalance(assetIdFromStr(assetIdB))
796- let $t02453624625 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore))
797- let tokensAmountA = $t02453624625._1
798- let tokensAmountB = $t02453624625._2
799- let $t02462825324 = if ((debt > 0))
804+ let $t02461424703 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore))
805+ let tokensAmountA = $t02461424703._1
806+ let tokensAmountB = $t02461424703._2
807+ let $t02470625402 = if ((debt > 0))
800808 then {
801809 let amountToGetEx = if (if ((borrowAsset == assetIdA))
802810 then (debt > tokensAmountA)
819827 else throw("Strict value is not equal to itself.")
820828 }
821829 else $Tuple2(tokensAmountA, tokensAmountB)
822- let toUserAmountA = $t02462825324._1
823- let toUserAmountB = $t02462825324._2
830+ let toUserAmountA = $t02470625402._1
831+ let toUserAmountB = $t02470625402._2
824832 $Tuple7(toUserAmountA, assetIdA, toUserAmountB, assetIdB, cBalAAfter, cBalBAfter, shareId)
825833 }
826834 else throw("Strict value is not equal to itself.")
857865 else throw(($getType(@) + " couldn't be cast to Int"))
858866 }
859867 else 0
860- let $t02683626989 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset)
861- if (($t02683626989 == $t02683626989))
868+ let $t02691427067 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset)
869+ if (($t02691427067 == $t02691427067))
862870 then {
863- let shareId = $t02683626989._7
864- let cBalBAfter = $t02683626989._6
865- let cBalAAfter = $t02683626989._5
866- let assetIdB = $t02683626989._4
867- let toUserAmountB = $t02683626989._3
868- let assetIdA = $t02683626989._2
869- let toUserAmountA = $t02683626989._1
871+ let shareId = $t02691427067._7
872+ let cBalBAfter = $t02691427067._6
873+ let cBalAAfter = $t02691427067._5
874+ let assetIdB = $t02691427067._4
875+ let toUserAmountB = $t02691427067._3
876+ let assetIdA = $t02691427067._2
877+ let toUserAmountA = $t02691427067._1
870878 let closeDbtInv = if ((debt > 0))
871879 then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)])
872880 else 0
907915 let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN)
908916 let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN)
909917 let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB))
910- let $t02867528772 = if ((borrowId == aId))
918+ let $t02875328850 = if ((borrowId == aId))
911919 then $Tuple2(dPriceA, decPrA)
912920 else $Tuple2(dPriceB, decPrB)
913- let borrowPrice = $t02867528772._1
914- let borrowDecPr = $t02867528772._2
921+ let borrowPrice = $t02875328850._1
922+ let borrowDecPr = $t02875328850._2
915923 fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice)
916924 }
917925
923931 then throw("Leverage can't be <100 and >300")
924932 else {
925933 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
926- let $t02918429274 = getPoolData(Address(fromBase58String(pool)), pType)
927- let AId = $t02918429274._1
928- let BId = $t02918429274._2
929- let balA = $t02918429274._3
930- let balB = $t02918429274._4
931- let shareId = $t02918429274._5
934+ let $t02926229352 = getPoolData(Address(fromBase58String(pool)), pType)
935+ let AId = $t02926229352._1
936+ let BId = $t02926229352._2
937+ let balA = $t02926229352._3
938+ let balB = $t02926229352._4
939+ let shareId = $t02926229352._5
932940 let borrowAmount = if ((leverage > 100))
933941 then calcBorrowAmount(pmtA, pmtB, AId, BId, leverage, borrowId)
934942 else 0
935- let $t02940929516 = if ((borrowId == AId))
943+ let $t02948729594 = if ((borrowId == AId))
936944 then $Tuple2((pmtA + borrowAmount), pmtB)
937945 else $Tuple2(pmtA, (pmtB + borrowAmount))
938- let payInA = $t02940929516._1
939- let payInB = $t02940929516._2
946+ let payInA = $t02948729594._1
947+ let payInB = $t02948729594._2
940948 let lpAmount = calcReplenishLPVirt(pType, pool, payInA, AId, payInB, BId, balA, balB)
941949 let newBalA = (balA + payInA)
942950 let newBalB = (balB + payInB)
943- let $t02967329809 = calcWithdrawLPVirt(pType, pool, lpAmount, shareId, AId, BId, newBalA, newBalB, borrowAmount, borrowId)
944- if (($t02967329809 == $t02967329809))
951+ let $t02975129887 = calcWithdrawLPVirt(pType, pool, lpAmount, shareId, AId, BId, newBalA, newBalB, borrowAmount, borrowId)
952+ if (($t02975129887 == $t02975129887))
945953 then {
946- let amountGetB = $t02967329809._2
947- let amountGetA = $t02967329809._1
954+ let amountGetB = $t02975129887._2
955+ let amountGetA = $t02975129887._1
948956 let ratioBefore = fraction(balB, SCALE8, balA)
949957 let ratioAfter = fraction((newBalB - amountGetB), SCALE8, (newBalA - amountGetA))
950958 let impact = (SCALE8 - fraction(ratioBefore, SCALE8, ratioAfter))
960968
961969 @Callable(i)
962970 func getShareAssetPriceREADONLY (shareId) = {
963- let sharePrices = getSharePrice([shareId])
964- $Tuple2(nil, sharePrices[0])
971+ let sharePrices = getSharePrice(shareId)
972+ $Tuple2(nil, sharePrices)
965973 }
966974
967975
977985
978986
979987 @Callable(i)
988+func getUserPositionInDollarsREADONLY (user,pools,posNum) = {
989+ func userPos (a,pool) = {
990+ let $t03092530959 = a
991+ let totalPos = $t03092530959._1
992+ let posDebt = $t03092530959._2
993+ let index = $t03092530959._3
994+ let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
995+ let $t03105131141 = getPoolData(Address(fromBase58String(pool)), pType)
996+ let AId = $t03105131141._1
997+ let BId = $t03105131141._2
998+ let balA = $t03105131141._3
999+ let balB = $t03105131141._4
1000+ let shareId = $t03105131141._5
1001+ let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0)
1002+ let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0))
1003+ let sharePrices = getSharePrice(shareId)
1004+ let decPrShare = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN)
1005+ let shareD = fraction(userCanWithdraw, sharePrices, decPrShare)
1006+ if ((borrowAmount == 0))
1007+ then $Tuple3((totalPos :+ shareD), (posDebt :+ 0), (index + 1))
1008+ else {
1009+ let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAssetId))
1010+ let debt = {
1011+ let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((((pool + "_") + user) + "_") + posNum[index]), borrowAsset], nil)
1012+ if ($isInstanceOf(@, "Int"))
1013+ then @
1014+ else throw(($getType(@) + " couldn't be cast to Int"))
1015+ }
1016+ let borrowAssetPrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [borrowAsset, false], nil)
1017+ if ($isInstanceOf(@, "(Int, Int)"))
1018+ then @
1019+ else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1
1020+ let decPrBorrowId = pow(10, 0, getAssetDecimals(borrowAsset), 0, 0, DOWN)
1021+ let debtD = fraction(debt, borrowAssetPrice, decPrBorrowId)
1022+ $Tuple3((totalPos :+ shareD), (posDebt :+ debtD), (index + 1))
1023+ }
1024+ }
1025+
1026+ let $t03219732252 = {
1027+ let $l = pools
1028+ let $s = size($l)
1029+ let $acc0 = $Tuple3(nil, nil, 0)
1030+ func $f0_1 ($a,$i) = if (($i >= $s))
1031+ then $a
1032+ else userPos($a, $l[$i])
1033+
1034+ func $f0_2 ($a,$i) = if (($i >= $s))
1035+ then $a
1036+ else throw("List size exceeds 20")
1037+
1038+ $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)
1039+ }
1040+ let pos = $t03219732252._1
1041+ let debt = $t03219732252._2
1042+ $Tuple2(nil, $Tuple2(pos, debt))
1043+ }
1044+
1045+
1046+
1047+@Callable(i)
9801048 func replenish (pool,leverage,borrowId) = if (if ((100 > leverage))
9811049 then true
9821050 else (leverage > 300))
9831051 then throw("Leverage can't be <100 and >300")
9841052 else {
9851053 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
986- let $t03095831048 = getPoolData(Address(fromBase58String(pool)), pType)
987- let AId = $t03095831048._1
988- let BId = $t03095831048._2
989- let balA = $t03095831048._3
990- let balB = $t03095831048._4
991- let shareId = $t03095831048._5
992- let $t03105131688 = if ((size(i.payments) == 2))
1054+ let $t03257532665 = getPoolData(Address(fromBase58String(pool)), pType)
1055+ let AId = $t03257532665._1
1056+ let BId = $t03257532665._2
1057+ let balA = $t03257532665._3
1058+ let balB = $t03257532665._4
1059+ let shareId = $t03257532665._5
1060+ let $t03266833305 = if ((size(i.payments) == 2))
9931061 then if ((assetIdToStr(i.payments[0].assetId) != AId))
9941062 then throw("Wrong payment asset A")
9951063 else if ((assetIdToStr(i.payments[1].assetId) != BId))
10021070 then $Tuple4(0, AId, i.payments[0].amount, BId)
10031071 else throw("Wrong payment")
10041072 else throw("One or two payments expected")
1005- let pmtA = $t03105131688._1
1006- let pmtAssetA = $t03105131688._2
1007- let pmtB = $t03105131688._3
1008- let pmtAssetB = $t03105131688._4
1073+ let pmtA = $t03266833305._1
1074+ let pmtAssetA = $t03266833305._2
1075+ let pmtB = $t03266833305._3
1076+ let pmtAssetB = $t03266833305._4
10091077 let newPosNum = getNewUserPositionNumber(pool, toString(i.caller))
10101078 if ((leverage > 100))
10111079 then {
10281096 else throw("Strict value is not equal to itself.")
10291097 }
10301098 else {
1031- let $t03262232734 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1032- let userStaked = $t03262232734._1
1033- let axlyFee = $t03262232734._2
1099+ let $t03423934351 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1100+ let userStaked = $t03423934351._1
1101+ let axlyFee = $t03423934351._2
10341102 (replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId))
10351103 }
10361104 }
10391107
10401108 @Callable(i)
10411109 func replenishFromLand (requestId) = {
1042- let $t03294533049 = parseRequest(requestId)
1043- let user = $t03294533049._1
1044- let pool = $t03294533049._2
1045- let pmtA = $t03294533049._3
1046- let AId = $t03294533049._4
1047- let pmtB = $t03294533049._5
1048- let BId = $t03294533049._6
1049- let balA = $t03294533049._7
1050- let balB = $t03294533049._8
1051- let shareId = $t03294533049._9
1052- let bwAsset = $t03294533049._10
1053- let bwAmount = $t03294533049._11
1110+ let $t03456234666 = parseRequest(requestId)
1111+ let user = $t03456234666._1
1112+ let pool = $t03456234666._2
1113+ let pmtA = $t03456234666._3
1114+ let AId = $t03456234666._4
1115+ let pmtB = $t03456234666._5
1116+ let BId = $t03456234666._6
1117+ let balA = $t03456234666._7
1118+ let balB = $t03456234666._8
1119+ let shareId = $t03456234666._9
1120+ let bwAsset = $t03456234666._10
1121+ let bwAmount = $t03456234666._11
10541122 if ((size(i.payments) != 1))
10551123 then throw("Wrong payment size")
10561124 else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset))
10581126 else (i.payments[0].amount != bwAmount))
10591127 then throw("Wrong payment")
10601128 else {
1061- let $t03323933363 = if ((AId == bwAsset))
1129+ let $t03485634980 = if ((AId == bwAsset))
10621130 then $Tuple2((pmtA + i.payments[0].amount), pmtB)
10631131 else $Tuple2(pmtA, (pmtB + i.payments[0].amount))
1064- let pmtAllA = $t03323933363._1
1065- let pmtAllB = $t03323933363._2
1132+ let pmtAllA = $t03485634980._1
1133+ let pmtAllB = $t03485634980._2
10661134 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool")
1067- let $t03344533554 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1068- let userStaked = $t03344533554._1
1069- let axlyFee = $t03344533554._2
1135+ let $t03506235171 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1136+ let userStaked = $t03506235171._1
1137+ let axlyFee = $t03506235171._2
10701138 let posNum = getNewUserPositionNumber(pool, toString(i.caller))
10711139 let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)]
10721140 let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true)
11301198 func liquidate (user,posId,liquidateAmount) = {
11311199 let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position")
11321200 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
1133- let $t03633736427 = getPoolData(Address(fromBase58String(pool)), pType)
1134- let AId = $t03633736427._1
1135- let BId = $t03633736427._2
1136- let balA = $t03633736427._3
1137- let balB = $t03633736427._4
1138- let shareId = $t03633736427._5
1201+ let $t03795438044 = getPoolData(Address(fromBase58String(pool)), pType)
1202+ let AId = $t03795438044._1
1203+ let BId = $t03795438044._2
1204+ let balA = $t03795438044._3
1205+ let balB = $t03795438044._4
1206+ let shareId = $t03795438044._5
11391207 let amount = unstakeLP(pool, pType, shareId, liquidateAmount)
11401208 let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount))
11411209 let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId))
11491217
11501218 @Callable(i)
11511219 func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = {
1152- let $t03766237856 = if (claim)
1220+ let $t03927939473 = if (claim)
11531221 then claimFarmed(type, pool)
11541222 else {
11551223 let claimedAsset = if ((type == SF_POOL))
11571225 else WXID
11581226 $Tuple2(amountToExchange, claimedAsset)
11591227 }
1160- let claimedAmount = $t03766237856._1
1161- let claimedAsset = $t03766237856._2
1228+ let claimedAmount = $t03927939473._1
1229+ let claimedAsset = $t03927939473._2
11621230 let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options)
11631231 let change = (claimedAmount - amountToExchange)
11641232 let changeEntry = if ((change > 0))
11711239
11721240 @Callable(i)
11731241 func capitalizeExPuzzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = {
1174- let $t03851338707 = if (claim)
1242+ let $t04013040324 = if (claim)
11751243 then claimFarmed(type, pool)
11761244 else {
11771245 let claimedAsset = if ((type == SF_POOL))
11791247 else WXID
11801248 $Tuple2(amountToExchange, claimedAsset)
11811249 }
1182- let claimedAmount = $t03851338707._1
1183- let claimedAsset = $t03851338707._2
1250+ let claimedAmount = $t04013040324._1
1251+ let claimedAsset = $t04013040324._2
11841252 let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options)
11851253 let change = (claimedAmount - amountToExchange)
11861254 let changeEntry = if ((change > 0))
11931261
11941262 @Callable(i)
11951263 func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = {
1196- let $t03943039624 = if (claim)
1264+ let $t04104741241 = if (claim)
11971265 then claimFarmed(type, pool)
11981266 else {
11991267 let claimedAsset = if ((type == SF_POOL))
12011269 else WXID
12021270 $Tuple2(amountToExchange, claimedAsset)
12031271 }
1204- let claimedAmount = $t03943039624._1
1205- let claimedAsset = $t03943039624._2
1272+ let claimedAmount = $t04104741241._1
1273+ let claimedAsset = $t04104741241._2
12061274 let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options)
12071275 let change = (claimedAmount - amountToExchange)
12081276 let changeEntry = if ((change > 0))
12191287 else false)
12201288 then throw("Wrong type")
12211289 else {
1222- let $t04031740411 = getPoolData(Address(fromBase58String(poolAddr)), type)
1223- let aId = $t04031740411._1
1224- let bId = $t04031740411._2
1225- let aBal = $t04031740411._3
1226- let bBal = $t04031740411._4
1227- let shareId = $t04031740411._5
1290+ let $t04193442028 = getPoolData(Address(fromBase58String(poolAddr)), type)
1291+ let aId = $t04193442028._1
1292+ let bId = $t04193442028._2
1293+ let aBal = $t04193442028._3
1294+ let bBal = $t04193442028._4
1295+ let shareId = $t04193442028._5
12281296 [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)]
12291297 }
12301298
12331301 @Callable(i)
12341302 func capitalizeTest (pool,pType,tokenId,tokenAmount) = {
12351303 let poolAddr = Address(fromBase58String(pool))
1236- let $t04120741286 = getPoolData(poolAddr, pType)
1237- let AId = $t04120741286._1
1238- let BId = $t04120741286._2
1239- let balA = $t04120741286._3
1240- let balB = $t04120741286._4
1241- let shareId = $t04120741286._5
1242- let $t04128941369 = if ((tokenId == AId))
1304+ let $t04282442903 = getPoolData(poolAddr, pType)
1305+ let AId = $t04282442903._1
1306+ let BId = $t04282442903._2
1307+ let balA = $t04282442903._3
1308+ let balB = $t04282442903._4
1309+ let shareId = $t04282442903._5
1310+ let $t04290642986 = if ((tokenId == AId))
12431311 then $Tuple2(tokenAmount, 0)
12441312 else $Tuple2(0, tokenAmount)
1245- let pmtA = $t04128941369._1
1246- let pmtB = $t04128941369._2
1247- let $t04137241476 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1248- let stakedAmount = $t04137241476._1
1249- let nf = $t04137241476._2
1313+ let pmtA = $t04290642986._1
1314+ let pmtB = $t04290642986._2
1315+ let $t04298943093 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1316+ let stakedAmount = $t04298943093._1
1317+ let nf = $t04298943093._2
12501318 let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0)
12511319 let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0)
12521320 let totalShareAmount = getPoolTotalShare(pool)
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 FEE_SCALE6 = 1000000
2727
2828 let kSFPoolAAssetBalance = "A_asset_balance"
2929
3030 let kSFPoolBAssetBalance = "B_asset_balance"
3131
3232 let kSFPoolAAssetId = "A_asset_id"
3333
3434 let kSFPoolBAssetId = "B_asset_id"
3535
3636 let kSFPoolShareId = "share_asset_id"
3737
3838 let kSFPoolShareSupply = "share_asset_supply"
3939
4040 let kSFPoolFee = "commission"
4141
4242 let kUserPosition = "_user_position"
4343
4444 let kUserPositionPool = "_user_position_pool"
4545
4646 let kUserBorrowAmount = "_user_position_borrow_amount"
4747
4848 let kUserBorrowAssetId = "_user_position_borrow_asset_id"
4949
5050 let kUserPositionNum = "_user_position_number"
5151
5252 let kUserPositionInterest = "_user_position_interest"
5353
5454 let kPoolTotal = "_pool_total"
5555
5656 let kPoolTotalLoan = "_pool_total_loan"
5757
5858 let kPoolInterestLoan = "_pool_interest_loan"
5959
6060 let kPoolInterestNoLoan = "_pool_interest_no_loan"
6161
6262 let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan"
6363
6464 let kAxlyInFeeWithLoan = "_axly_fee_with_loan"
6565
6666 let kAxlyNoLoanCapFee = "_axly_fee_cap_with_loan"
6767
6868 let kAxlyWithLoanCapFee = "_axly_fee_cap_no_loan"
6969
7070 let kAxlyStopLossNoLoanFee = "_axly_fee_stoploss_with_loan"
7171
7272 let kAxlyStopLossLoanFee = "_axly_fee_stoploss_no_loan"
7373
7474 let kRequestId = "_request_id"
7575
7676 let kRequestIter = "requests_iter"
7777
7878 let kPool = "pool_"
7979
8080 let kSharePool = "_pool_share_id"
8181
8282 let kPoolCapChange = "_pool_cap_change"
8383
8484 let kTokenLastPrice = "last_price"
8585
8686 let kUserStopLoss = "_stop_loss"
8787
8888 let kMoneyBox = "axly_money_box"
8989
9090 let kSFFarmingAddr = "swopfi_farming_addr"
9191
9292 let kLendService = "lend_service_addr"
9393
9494 let kPriceOracle = "price_oracle"
9595
9696 let kExContract = "exchange_contract"
9797
9898 let kWxSwapContract = "wx_swap_contract"
9999
100100 let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address")))
101101
102102 let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address")))
103103
104104 let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address")))
105105
106106 let wxSwapContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kWxSwapContract), "No wx swap address")))
107107
108108 let SWOPID = base58'4W19ndijcc2CsQa9HGW2dfXKTVXhnneWWttxXrtjPmEp'
109109
110110 let WXID = base58'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc'
111111
112112 func isSelfCall (i) = if ((i.caller == this))
113113 then unit
114114 else throw("Only contract itself can call this function")
115115
116116
117117 func accountBalance (assetId) = match assetId {
118118 case id: ByteVector =>
119119 assetBalance(this, id)
120120 case waves: Unit =>
121121 wavesBalance(this).available
122122 case _ =>
123123 throw("Match error")
124124 }
125125
126126
127127 func getSFPoolData (poolAddr) = $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolAAssetBalance), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolBAssetBalance), "Can't get pool B asset balance"), valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id"))
128128
129129
130130 func getWXPoolData (poolAddr) = {
131131 let cfg = {
132132 let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil)
133133 if ($isInstanceOf(@, "List[Any]"))
134134 then @
135135 else throw(($getType(@) + " couldn't be cast to List[Any]"))
136136 }
137137 if ((cfg == cfg))
138138 then {
139139 let aId = valueOrErrorMessage({
140140 let @ = cfg[4]
141141 if ($isInstanceOf(@, "String"))
142142 then @
143143 else unit
144144 }, "Can't get pool A asset id")
145145 let bId = valueOrErrorMessage({
146146 let @ = cfg[5]
147147 if ($isInstanceOf(@, "String"))
148148 then @
149149 else unit
150150 }, "Can't get pool B asset id")
151151 let shareId = valueOrErrorMessage({
152152 let @ = cfg[3]
153153 if ($isInstanceOf(@, "String"))
154154 then @
155155 else unit
156156 }, "Can't get pool LP asset id")
157157 let balA = {
158158 let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [aId], nil)
159159 if ($isInstanceOf(@, "Int"))
160160 then @
161161 else throw(($getType(@) + " couldn't be cast to Int"))
162162 }
163163 if ((balA == balA))
164164 then {
165165 let balB = {
166166 let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [bId], nil)
167167 if ($isInstanceOf(@, "Int"))
168168 then @
169169 else throw(($getType(@) + " couldn't be cast to Int"))
170170 }
171171 if ((balB == balB))
172172 then $Tuple5(aId, bId, balA, balB, shareId)
173173 else throw("Strict value is not equal to itself.")
174174 }
175175 else throw("Strict value is not equal to itself.")
176176 }
177177 else throw("Strict value is not equal to itself.")
178178 }
179179
180180
181181 func getPoolData (poolAddr,type) = if ((type == SF_POOL))
182182 then getSFPoolData(poolAddr)
183183 else if ((type == WX_POOL))
184184 then getWXPoolData(poolAddr)
185185 else throw("Wrong pool type")
186186
187187
188188 func getShareSupply (poolAddr,type,shareId) = if ((type == SF_POOL))
189189 then valueOrErrorMessage(getInteger(poolAddr, kSFPoolShareSupply), "Can't get share asset supply")
190190 else if ((type == WX_POOL))
191191 then valueOrErrorMessage(assetInfo(fromBase58String(shareId)), "Wrong ShareId").quantity
192192 else throw("Wrong pool type")
193193
194194
195195 func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0)
196196
197197
198198 func getPoolTotalShareWithLoan (pool) = valueOrElse(getInteger(this, (pool + kPoolTotalLoan)), 0)
199199
200200
201201 func getNewUserPositionNumber (pool,user) = (valueOrElse(getInteger(this, (user + kUserPositionNum)), 0) + 1)
202202
203203
204204 func getAxlyFee (pool,feeType) = if ((feeType == CAP_FEE_LOAN))
205205 then getIntegerValue(this, (pool + kAxlyWithLoanCapFee))
206206 else if ((feeType == CAP_FEE_NO_LOAN))
207207 then getIntegerValue(this, (pool + kAxlyNoLoanCapFee))
208208 else if ((feeType == LOAN_FEE))
209209 then getIntegerValue(this, (pool + kAxlyInFeeWithLoan))
210210 else if ((feeType == NO_LOAN_FEE))
211211 then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan))
212212 else if ((feeType == NO_FEE))
213213 then 0
214214 else throw("Wrong fee type")
215215
216216
217217 func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr")))
218218
219219
220220 func getWXFarmingAddr (poolAddr) = {
221221 let fContract = Address(fromBase58String(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr")))
222222 let factroyCfg = split(valueOrErrorMessage(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__")
223223 Address(fromBase58String(factroyCfg[1]))
224224 }
225225
226226
227227 func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr")))
228228
229229
230230 func assetIdToStr (assetId) = match assetId {
231231 case id: ByteVector =>
232232 toBase58String(id)
233233 case waves: Unit =>
234234 "WAVES"
235235 case _ =>
236236 throw("Match error")
237237 }
238238
239239
240240 func assetIdFromStr (assetId) = if ((assetId == "WAVES"))
241241 then unit
242242 else fromBase58String(assetId)
243243
244244
245245 func getAssetDecimals (assetId) = if ((assetId == "WAVES"))
246246 then 8
247247 else match assetInfo(fromBase58String(assetId)) {
248248 case asset: Asset =>
249249 asset.decimals
250250 case _ =>
251251 throw("Can't find asset")
252252 }
253253
254254
255255 func getAssetPrecition (assetId) = pow(10, 0, getAssetDecimals(assetId), 0, 0, DOWN)
256256
257257
258258 func getAssetsPrice (assetIds) = {
259259 func getPrices (a,assetId) = {
260260 let assetPrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil)
261261 if ($isInstanceOf(@, "(Int, Int)"))
262262 then @
263263 else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2
264264 (a :+ assetPrice)
265265 }
266266
267267 let $l = assetIds
268268 let $s = size($l)
269269 let $acc0 = nil
270270 func $f0_1 ($a,$i) = if (($i >= $s))
271271 then $a
272272 else getPrices($a, $l[$i])
273273
274274 func $f0_2 ($a,$i) = if (($i >= $s))
275275 then $a
276- else throw("List size exceeds 100")
276+ else throw("List size exceeds 50")
277277
278- $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($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), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100)
278+ $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)
279279 }
280280
281281
282-func getSharePrice (shareIds) = {
283- func getPrices (a,shareId) = {
284- let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id")
285- let poolAddr = Address(fromBase58String(pool))
286- let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
287- let $t084288493 = getPoolData(poolAddr, pType)
288- let aId = $t084288493._1
289- let bId = $t084288493._2
290- let aBalance = $t084288493._3
291- let bBalance = $t084288493._4
292- let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [aId, false], nil)
293- if ($isInstanceOf(@, "(Int, Int)"))
294- then @
295- else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2
296- let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [bId, false], nil)
297- if ($isInstanceOf(@, "(Int, Int)"))
298- then @
299- else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2
300- let shareSupply = getShareSupply(poolAddr, pType, shareId)
301- let APrecision = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN)
302- let BPrecision = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN)
303- let sharePrecision = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN)
304- let sum = (fraction(aBalance, dPriceA, APrecision) + fraction(bBalance, dPriceB, BPrecision))
305- let sharePrice = fraction(sum, sharePrecision, shareSupply)
306- (a :+ sharePrice)
307- }
282+func getSharePrice (shareId) = {
283+ let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id")
284+ let poolAddr = Address(fromBase58String(pool))
285+ let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
286+ let $t083618426 = getPoolData(poolAddr, pType)
287+ let aId = $t083618426._1
288+ let bId = $t083618426._2
289+ let aBalance = $t083618426._3
290+ let bBalance = $t083618426._4
291+ let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [aId, false], nil)
292+ if ($isInstanceOf(@, "(Int, Int)"))
293+ then @
294+ else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2
295+ let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [bId, false], nil)
296+ if ($isInstanceOf(@, "(Int, Int)"))
297+ then @
298+ else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2
299+ let shareSupply = getShareSupply(poolAddr, pType, shareId)
300+ let APrecision = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN)
301+ let BPrecision = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN)
302+ let sharePrecision = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN)
303+ let sum = (fraction(aBalance, dPriceA, APrecision) + fraction(bBalance, dPriceB, BPrecision))
304+ fraction(sum, sharePrecision, shareSupply)
305+ }
306+
307+
308+func getSharePrices (shareIds) = {
309+ func getPrices (a,shareId) = (a :+ getSharePrice(shareId))
308310
309311 let $l = shareIds
310312 let $s = size($l)
311313 let $acc0 = nil
312314 func $f0_1 ($a,$i) = if (($i >= $s))
313315 then $a
314316 else getPrices($a, $l[$i])
315317
316318 func $f0_2 ($a,$i) = if (($i >= $s))
317319 then $a
318- else throw("List size exceeds 50")
320+ else throw("List size exceeds 20")
319321
320- $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)
322+ $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)
321323 }
322324
323325
324326 func getCursEntries (aId,bId,shareId) = {
325327 let assetsPrices = getAssetsPrice([aId, bId])
326- let sharePrice = getSharePrice([shareId])
327- let prices = [toString(assetsPrices[0]), toString(assetsPrices[1]), toString(sharePrice[0])]
328+ let sharePrice = getSharePrice(shareId)
329+ let prices = [toString(assetsPrices[0]), toString(assetsPrices[1]), toString(sharePrice)]
328330 [StringEntry(kTokenLastPrice, makeString(prices, ","))]
329331 }
330332
331333
332334 func calcReplenishByTwoTokens (pType,poolAddr,pmtA,aId,pmtB,bId,balA,balB) = {
333- let $t096459950 = if ((pType == SF_POOL))
335+ let $t096549959 = if ((pType == SF_POOL))
334336 then $Tuple2(nil, nil)
335337 else $Tuple2(split({
336338 let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil)
337339 if ($isInstanceOf(@, "String"))
338340 then @
339341 else throw(($getType(@) + " couldn't be cast to String"))
340342 }, "__"), split({
341343 let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil)
342344 if ($isInstanceOf(@, "String"))
343345 then @
344346 else throw(($getType(@) + " couldn't be cast to String"))
345347 }, "__"))
346- if (($t096459950 == $t096459950))
348+ if (($t096549959 == $t096549959))
347349 then {
348- let evalPutInB = $t096459950._2
349- let evalPutInA = $t096459950._1
350- let $t0996010156 = if ((pType == SF_POOL))
350+ let evalPutInB = $t096549959._2
351+ let evalPutInA = $t096549959._1
352+ let $t0996910165 = if ((pType == SF_POOL))
351353 then $Tuple2(fraction(SCALE8, pmtA, balA), fraction(SCALE8, pmtB, balB))
352354 else $Tuple2(parseIntValue(evalPutInA[1]), parseIntValue(evalPutInB[1]))
353- let ratioA = $t0996010156._1
354- let ratioB = $t0996010156._2
355- let $t01016210644 = if ((ratioB > ratioA))
355+ let ratioA = $t0996910165._1
356+ let ratioB = $t0996910165._2
357+ let $t01017110653 = if ((ratioB > ratioA))
356358 then {
357359 let pmt = if ((pType == SF_POOL))
358360 then fraction(balB, ratioA, SCALE8, CEILING)
359361 else parseIntValue(evalPutInA[8])
360362 $Tuple5(pmtA, pmt, (pmtB - pmt), bId, ratioB)
361363 }
362364 else {
363365 let pmt = if ((pType == SF_POOL))
364366 then fraction(balA, ratioB, SCALE8, CEILING)
365367 else parseIntValue(evalPutInB[7])
366368 $Tuple5(pmt, pmtB, (pmtA - pmt), aId, ratioA)
367369 }
368- let pmtInA = $t01016210644._1
369- let pmtInB = $t01016210644._2
370- let change = $t01016210644._3
371- let changeAssetId = $t01016210644._4
372- let lp = $t01016210644._5
370+ let pmtInA = $t01017110653._1
371+ let pmtInB = $t01017110653._2
372+ let change = $t01017110653._3
373+ let changeAssetId = $t01017110653._4
374+ let lp = $t01017110653._5
373375 $Tuple5(pmtInA, pmtInB, change, changeAssetId, lp)
374376 }
375377 else throw("Strict value is not equal to itself.")
376378 }
377379
378380
379381 func replenishTwoTokensByType (poolAddr,pType,pmtA,aId,pmtB,bId) = {
380382 let payments = [AttachedPayment(assetIdFromStr(aId), pmtA), AttachedPayment(assetIdFromStr(bId), pmtB)]
381383 if ((pType == SF_POOL))
382384 then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments)
383385 else invoke(poolAddr, "put", [1000000, false], payments)
384386 }
385387
386388
387389 func replenishOneTokenByType (poolAddr,pType,pmt,pmtId) = {
388390 let payments = [AttachedPayment(assetIdFromStr(pmtId), pmt)]
389391 if ((pType == SF_POOL))
390392 then invoke(poolAddr, "callFunction", ["replenishWithOneToken", ["0", "false", "0"]], payments)
391393 else invoke(poolAddr, "putOneTkn", [0, false], payments)
392394 }
393395
394396
395397 func stakeLP (pool,pType,shareId,amount) = {
396398 let payments = [AttachedPayment(fromBase58String(shareId), amount)]
397399 if ((pType == SF_POOL))
398400 then invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], payments)
399401 else invoke(getWXFarmingAddr(addressFromStringValue(pool)), "stake", nil, payments)
400402 }
401403
402404
403405 func unstakeLP (pool,pType,shareId,amount) = {
404- let $t01187412231 = if ((pType == SF_POOL))
406+ let $t01188312240 = if ((pType == SF_POOL))
405407 then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount])
406408 else if ((pType == WX_POOL))
407409 then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount])
408410 else throw("Wrong pool type")
409- let farmAddr = $t01187412231._1
410- let fName = $t01187412231._2
411- let params = $t01187412231._3
411+ let farmAddr = $t01188312240._1
412+ let fName = $t01188312240._2
413+ let params = $t01188312240._3
412414 let inv = invoke(farmAddr, fName, params, nil)
413415 if ((inv == inv))
414416 then amount
415417 else throw("Strict value is not equal to itself.")
416418 }
417419
418420
419421 func calcAmountToPaySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = {
420422 let poolAddr = Address(fromBase58String(pool))
421423 let feeScale6 = 1000000
422424 let fee = getIntegerValue(poolAddr, kSFPoolFee)
423425 let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee))
424- let $t01264412932 = if ((assetTokenToGet == assetIdA))
426+ let $t01265312941 = if ((assetTokenToGet == assetIdA))
425427 then {
426428 let amountToPay = fraction(balA, amntGetNoFee, (balB - amntGetNoFee))
427429 $Tuple2(amountToPay, assetIdB)
428430 }
429431 else {
430432 let amountToPay = fraction(balB, amntGetNoFee, (balA - amntGetNoFee))
431433 $Tuple2(amountToPay, assetIdA)
432434 }
433- let amountToPay = $t01264412932._1
434- let assetToPay = $t01264412932._2
435+ let amountToPay = $t01265312941._1
436+ let assetToPay = $t01265312941._2
435437 $Tuple2(assetToPay, amountToPay)
436438 }
437439
438440
439441 func calcAmountToPayWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = {
440442 let prFee = getIntegerValue(wxSwapContract, "%s__protocolFee")
441443 let pFee = getIntegerValue(wxSwapContract, "%s__poolFee")
442444 let feeScale = toBigInt(100000000)
443- let $t01327113579 = if ((assetTokenToGet == assetIdA))
445+ let $t01328013588 = if ((assetTokenToGet == assetIdA))
444446 then {
445447 let amountToPay = fraction(balA, amountTokenToGet, (balB - amountTokenToGet))
446448 $Tuple2(amountToPay, assetIdB)
447449 }
448450 else {
449451 let amountToPay = fraction(balB, amountTokenToGet, (balA - amountTokenToGet))
450452 $Tuple2(amountToPay, assetIdA)
451453 }
452- let amountToPay = $t01327113579._1
453- let assetToPay = $t01327113579._2
454+ let amountToPay = $t01328013588._1
455+ let assetToPay = $t01328013588._2
454456 let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee)))))
455457 $Tuple2(assetToPay, amountToPayWithFee)
456458 }
457459
458460
459461 func exchangeDirectly (type,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = if ((type == SF_POOL))
460462 then {
461- let $t01391714039 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
462- let assetToPay = $t01391714039._1
463- let amountToPay = $t01391714039._2
463+ let $t01392614048 = calcAmountToPaySF(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
464+ let assetToPay = $t01392614048._1
465+ let amountToPay = $t01392614048._2
464466 invoke(addressFromStringValue(pool), "callFunction", ["exchange", ["1"]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)])
465467 }
466468 else {
467- let $t01419014312 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
468- let assetToPay = $t01419014312._1
469- let amountToPay = $t01419014312._2
469+ let $t01419914321 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet)
470+ let assetToPay = $t01419914321._1
471+ let amountToPay = $t01419914321._2
470472 invoke(wxSwapContract, "swap", [1, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)])
471473 }
472474
473475
474476 func calcReplenishLPVirt (pType,pool,pmtA,aId,pmtB,bId,balA,balB) = {
475477 let poolAddr = addressFromStringValue(pool)
476478 if ((pType == SF_POOL))
477479 then {
478480 let inv = {
479481 let @ = invoke(poolAddr, "callFunction", ["calcLPReplenishDiffPropREADONLY", [toString(pmtA), toString(pmtB), "0"]], nil)
480482 if ($isInstanceOf(@, "List[Any]"))
481483 then @
482484 else throw(($getType(@) + " couldn't be cast to List[Any]"))
483485 }
484486 if ((inv == inv))
485487 then {
486488 let @ = inv[0]
487489 if ($isInstanceOf(@, "Int"))
488490 then @
489491 else throw(($getType(@) + " couldn't be cast to Int"))
490492 }
491493 else throw("Strict value is not equal to itself.")
492494 }
493495 else if ((pType == WX_POOL))
494496 then {
495- let $t01487715218 = if (if ((pmtA > 0))
497+ let $t01488615227 = if (if ((pmtA > 0))
496498 then (pmtB > 0)
497499 else false)
498500 then {
499- let $t01495815084 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
500- let pmtInA = $t01495815084._1
501- let pmtInB = $t01495815084._2
502- let change = $t01495815084._3
503- let changeId = $t01495815084._4
504- let lpAmount = $t01495815084._5
501+ let $t01496715093 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
502+ let pmtInA = $t01496715093._1
503+ let pmtInB = $t01496715093._2
504+ let change = $t01496715093._3
505+ let changeId = $t01496715093._4
506+ let lpAmount = $t01496715093._5
505507 $Tuple3(change, changeId, lpAmount)
506508 }
507509 else if ((pmtA > 0))
508510 then $Tuple3(pmtA, aId, 0)
509511 else $Tuple3(pmtB, bId, 0)
510- let change = $t01487715218._1
511- let changeId = $t01487715218._2
512- let lpTwo = $t01487715218._3
512+ let change = $t01488615227._1
513+ let changeId = $t01488615227._2
514+ let lpTwo = $t01488615227._3
513515 let lpOne = if ((change > 0))
514516 then {
515517 let inv = {
516518 let @ = invoke(poolAddr, "putOneTknREADONLY", [changeId, change], nil)
517519 if ($isInstanceOf(@, "(Int, Int, Int)"))
518520 then @
519521 else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)"))
520522 }
521523 if ((inv == inv))
522524 then inv._1
523525 else throw("Strict value is not equal to itself.")
524526 }
525527 else 0
526528 (lpTwo + lpOne)
527529 }
528530 else throw("Wrong pool type")
529531 }
530532
531533
532534 func calcWithdrawLPVirt (pType,pool,lpAmount,shareId,aId,bId,balA,balB,borrowAmount,borrowAssetId) = {
533535 let poolAddr = addressFromStringValue(pool)
534- let $t01570416170 = if ((pType == SF_POOL))
536+ let $t01571316179 = if ((pType == SF_POOL))
535537 then {
536538 let inv = {
537539 let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(lpAmount)]], nil)
538540 if ($isInstanceOf(@, "List[Any]"))
539541 then @
540542 else throw(($getType(@) + " couldn't be cast to List[Any]"))
541543 }
542544 if ((inv == inv))
543545 then $Tuple2({
544546 let @ = inv[0]
545547 if ($isInstanceOf(@, "Int"))
546548 then @
547549 else throw(($getType(@) + " couldn't be cast to Int"))
548550 }, {
549551 let @ = inv[1]
550552 if ($isInstanceOf(@, "Int"))
551553 then @
552554 else throw(($getType(@) + " couldn't be cast to Int"))
553555 })
554556 else throw("Strict value is not equal to itself.")
555557 }
556558 else if ((pType == WX_POOL))
557559 then {
558560 let get = split({
559561 let @ = invoke(poolAddr, "evaluateGetREADONLY", [shareId, lpAmount], nil)
560562 if ($isInstanceOf(@, "String"))
561563 then @
562564 else throw(($getType(@) + " couldn't be cast to String"))
563565 }, "__")
564566 if ((get == get))
565567 then $Tuple2(parseIntValue(get[1]), parseIntValue(get[2]))
566568 else throw("Strict value is not equal to itself.")
567569 }
568570 else throw("Wrong pool type")
569- let getAmountA = $t01570416170._1
570- let getAmountB = $t01570416170._2
571+ let getAmountA = $t01571316179._1
572+ let getAmountB = $t01571316179._2
571573 if ((borrowAmount > 0))
572574 then {
573575 let amountToGetEx = if (if ((borrowAssetId == aId))
574576 then (borrowAmount > getAmountA)
575577 else false)
576578 then (borrowAmount - getAmountA)
577579 else if (if ((borrowAssetId == bId))
578580 then (borrowAmount > getAmountB)
579581 else false)
580582 then (borrowAmount - getAmountB)
581583 else 0
582- let $t01647316788 = if ((amountToGetEx > 0))
584+ let $t01648216797 = if ((amountToGetEx > 0))
583585 then if ((pType == SF_POOL))
584586 then calcAmountToPaySF(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId)
585587 else calcAmountToPayWX(pool, aId, bId, balA, balB, amountToGetEx, borrowAssetId)
586588 else $Tuple2("", 0)
587- let assetToPay = $t01647316788._1
588- let amountToPay = $t01647316788._2
589+ let assetToPay = $t01648216797._1
590+ let amountToPay = $t01648216797._2
589591 if ((borrowAssetId == aId))
590592 then $Tuple2(((getAmountA + amountToGetEx) - borrowAmount), (getAmountB - amountToPay))
591593 else $Tuple2((getAmountA - amountToPay), ((getAmountB + amountToGetEx) - borrowAmount))
592594 }
593595 else $Tuple2(getAmountA, getAmountB)
594596 }
595597
596598
597599 func claimFarmed (type,pool) = if ((type == SF_POOL))
598600 then {
599601 let balBefore = accountBalance(SWOPID)
600602 if ((balBefore == balBefore))
601603 then {
602604 let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil)
603605 if ((inv == inv))
604606 then {
605607 let balAfter = accountBalance(SWOPID)
606608 $Tuple2((balAfter - balBefore), SWOPID)
607609 }
608610 else throw("Strict value is not equal to itself.")
609611 }
610612 else throw("Strict value is not equal to itself.")
611613 }
612614 else if ((type == WX_POOL))
613615 then {
614616 let balBefore = accountBalance(WXID)
615617 if ((balBefore == balBefore))
616618 then {
617619 let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil)
618620 if ((inv == inv))
619621 then {
620622 let balAfter = accountBalance(WXID)
621623 $Tuple2((balAfter - balBefore), WXID)
622624 }
623625 else throw("Strict value is not equal to itself.")
624626 }
625627 else throw("Strict value is not equal to itself.")
626628 }
627629 else throw("Wrong pool type")
628630
629631
630632 func replenishByType (pType,pool,feeType,pmtA,aId,pmtB,bId,balA,balB,LPId) = {
631633 let lpBalanceBefore = accountBalance(fromBase58String(LPId))
632634 if ((lpBalanceBefore == lpBalanceBefore))
633635 then {
634636 let poolAddr = addressFromStringValue(pool)
635- let $t01799718413 = if (if ((pmtA > 0))
637+ let $t01800618422 = if (if ((pmtA > 0))
636638 then (pmtB > 0)
637639 else false)
638640 then {
639- let $t01806318179 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
640- let pmtInA = $t01806318179._1
641- let pmtInB = $t01806318179._2
642- let change = $t01806318179._3
643- let changeId = $t01806318179._4
641+ let $t01807218188 = calcReplenishByTwoTokens(pType, poolAddr, pmtA, aId, pmtB, bId, balA, balB)
642+ let pmtInA = $t01807218188._1
643+ let pmtInB = $t01807218188._2
644+ let change = $t01807218188._3
645+ let changeId = $t01807218188._4
644646 let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId)
645647 if ((inv == inv))
646648 then $Tuple2(change, changeId)
647649 else throw("Strict value is not equal to itself.")
648650 }
649651 else if ((pmtA > 0))
650652 then $Tuple2(pmtA, aId)
651653 else if ((pmtB > 0))
652654 then $Tuple2(pmtB, bId)
653655 else throw("pmts must be > 0")
654- let change = $t01799718413._1
655- let changeId = $t01799718413._2
656+ let change = $t01800618422._1
657+ let changeId = $t01800618422._2
656658 let inv = if ((change > 0))
657659 then replenishOneTokenByType(poolAddr, pType, change, changeId)
658660 else nil
659661 if ((inv == inv))
660662 then {
661663 let lpBalanceAfter = accountBalance(fromBase58String(LPId))
662664 let totalStaked = (lpBalanceAfter - lpBalanceBefore)
663665 let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6)
664666 let userShareForStake = (totalStaked - axlyFeeAmount)
665667 if ((0 >= userShareForStake))
666668 then throw("amount of staked sharetokens must be > 0")
667669 else {
668670 let invLP = stakeLP(pool, pType, LPId, userShareForStake)
669671 if ((invLP == invLP))
670672 then $Tuple2(userShareForStake, axlyFeeAmount)
671673 else throw("Strict value is not equal to itself.")
672674 }
673675 }
674676 else throw("Strict value is not equal to itself.")
675677 }
676678 else throw("Strict value is not equal to itself.")
677679 }
678680
679681
680682 func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = {
681683 let totalAmount = getPoolTotalShare(pool)
682684 let totalAmountLoan = getPoolTotalShareWithLoan(pool)
683- let $t01927119509 = if (withLoan)
685+ let $t01928019518 = if (withLoan)
684686 then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount))
685687 else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan)
686- let curPoolInterest = $t01927119509._1
687- let totalStakedWithLoan = $t01927119509._2
688+ let curPoolInterest = $t01928019518._1
689+ let totalStakedWithLoan = $t01928019518._2
688690 [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))]
689691 }
690692
691693
692694 func exchangeKeeper (toToken,pmtAmount,pmtAsset,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = {
693695 let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken))
694696 if ((tokenBalanceBefore == tokenBalanceBefore))
695697 then {
696698 let inv = invoke(exContract, "swap", [amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options], [AttachedPayment(pmtAsset, pmtAmount)])
697699 if ((inv == inv))
698700 then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore)
699701 else throw("Strict value is not equal to itself.")
700702 }
701703 else throw("Strict value is not equal to itself.")
702704 }
703705
704706
705707 func exchangePuzzle (toToken,pmtAmount,pmtAsset,routesStr,minToReceive,options) = {
706708 let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken))
707709 if ((tokenBalanceBefore == tokenBalanceBefore))
708710 then {
709711 let inv = invoke(exContract, "puzzleSwap", [routesStr, minToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)])
710712 if ((inv == inv))
711713 then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore)
712714 else throw("Strict value is not equal to itself.")
713715 }
714716 else throw("Strict value is not equal to itself.")
715717 }
716718
717719
718720 func exchangeSwopFi (toToken,pmtAmount,pmtAsset,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = {
719721 let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken))
720722 if ((tokenBalanceBefore == tokenBalanceBefore))
721723 then {
722724 let inv = invoke(exContract, "swopfiSwap", [exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)])
723725 if ((inv == inv))
724726 then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore)
725727 else throw("Strict value is not equal to itself.")
726728 }
727729 else throw("Strict value is not equal to itself.")
728730 }
729731
730732
731733 func capitalize (pool,pType,tokenId,tokenAmount) = {
732734 let poolAddr = Address(fromBase58String(pool))
733- let $t02186021939 = getPoolData(poolAddr, pType)
734- let AId = $t02186021939._1
735- let BId = $t02186021939._2
736- let balA = $t02186021939._3
737- let balB = $t02186021939._4
738- let shareId = $t02186021939._5
739- let $t02194222022 = if ((tokenId == AId))
740- then $Tuple2(tokenAmount, 0)
741- else $Tuple2(0, tokenAmount)
742- let pmtA = $t02194222022._1
743- let pmtB = $t02194222022._2
744- let $t02202522129 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
745- let stakedAmount = $t02202522129._1
746- let nf = $t02202522129._2
747- let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0)
748- let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0)
749- let totalShareAmount = getPoolTotalShare(pool)
750- let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool)
751- let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount)
752- let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8)
753- let stakedNoLoan = (stakedAmount - stakedLoan)
754- let newInterestLoan = if ((totalShareAmountWithLoan > 0))
755- then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan))
756- else 0
757- let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0))
758- then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan)))
759- else 0
760- let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6)
761- let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6)
762- let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan))
763- if ((axlyFee == axlyFee))
764- 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))
765- else throw("Strict value is not equal to itself.")
735+ let $t02186921935 = getPoolData(poolAddr, pType)
736+ let AId = $t02186921935._1
737+ let BId = $t02186921935._2
738+ let balA = $t02186921935._3
739+ let balB = $t02186921935._4
740+ let shareId = $t02186921935._5
741+ if (if ((tokenId != AId))
742+ then (tokenId != BId)
743+ else false)
744+ then throw("Wrong asset")
745+ else {
746+ let $t02202022100 = if ((tokenId == AId))
747+ then $Tuple2(tokenAmount, 0)
748+ else $Tuple2(0, tokenAmount)
749+ let pmtA = $t02202022100._1
750+ let pmtB = $t02202022100._2
751+ let $t02210322207 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
752+ let stakedAmount = $t02210322207._1
753+ let nf = $t02210322207._2
754+ let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0)
755+ let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0)
756+ let totalShareAmount = getPoolTotalShare(pool)
757+ let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool)
758+ let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount)
759+ let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8)
760+ let stakedNoLoan = (stakedAmount - stakedLoan)
761+ let newInterestLoan = if ((totalShareAmountWithLoan > 0))
762+ then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan))
763+ else 0
764+ let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0))
765+ then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan)))
766+ else 0
767+ let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6)
768+ let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6)
769+ let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan))
770+ if ((axlyFee == axlyFee))
771+ 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))
772+ else throw("Strict value is not equal to itself.")
773+ }
766774 }
767775
768776
769777 func withdrawAmountCalc (pool,userCanWithdraw,debt,borrowAsset) = {
770778 let poolAddr = Address(fromBase58String(pool))
771779 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool")
772- let $t02389723973 = getPoolData(poolAddr, pType)
773- let assetIdA = $t02389723973._1
774- let assetIdB = $t02389723973._2
775- let balA = $t02389723973._3
776- let balB = $t02389723973._4
777- let shareId = $t02389723973._5
780+ let $t02397524051 = getPoolData(poolAddr, pType)
781+ let assetIdA = $t02397524051._1
782+ let assetIdB = $t02397524051._2
783+ let balA = $t02397524051._3
784+ let balB = $t02397524051._4
785+ let shareId = $t02397524051._5
778786 let cBalABefore = accountBalance(assetIdFromStr(assetIdA))
779787 if ((cBalABefore == cBalABefore))
780788 then {
781789 let cBalBBefore = accountBalance(assetIdFromStr(assetIdB))
782790 if ((cBalBBefore == cBalBBefore))
783791 then {
784792 let inv = if ((pType == SF_POOL))
785793 then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil)
786794 else {
787795 let inv = unstakeLP(pool, pType, shareId, userCanWithdraw)
788796 if ((inv == inv))
789797 then invoke(poolAddr, "get", nil, [AttachedPayment(assetIdFromStr(shareId), userCanWithdraw)])
790798 else throw("Strict value is not equal to itself.")
791799 }
792800 if ((inv == inv))
793801 then {
794802 let cBalAAfter = accountBalance(assetIdFromStr(assetIdA))
795803 let cBalBAfter = accountBalance(assetIdFromStr(assetIdB))
796- let $t02453624625 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore))
797- let tokensAmountA = $t02453624625._1
798- let tokensAmountB = $t02453624625._2
799- let $t02462825324 = if ((debt > 0))
804+ let $t02461424703 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore))
805+ let tokensAmountA = $t02461424703._1
806+ let tokensAmountB = $t02461424703._2
807+ let $t02470625402 = if ((debt > 0))
800808 then {
801809 let amountToGetEx = if (if ((borrowAsset == assetIdA))
802810 then (debt > tokensAmountA)
803811 else false)
804812 then (debt - tokensAmountA)
805813 else if (if ((borrowAsset == assetIdB))
806814 then (debt > tokensAmountB)
807815 else false)
808816 then (debt - tokensAmountB)
809817 else 0
810818 let exInv = if ((amountToGetEx > 0))
811819 then exchangeDirectly(pType, pool, assetIdA, assetIdB, balA, balB, amountToGetEx, borrowAsset)
812820 else 0
813821 if ((exInv == exInv))
814822 then {
815823 let cBalAAfterRepay = accountBalance(assetIdFromStr(assetIdA))
816824 let cBalBAfterRepay = accountBalance(assetIdFromStr(assetIdB))
817825 $Tuple2((cBalAAfterRepay - cBalABefore), (cBalBAfterRepay - cBalBBefore))
818826 }
819827 else throw("Strict value is not equal to itself.")
820828 }
821829 else $Tuple2(tokensAmountA, tokensAmountB)
822- let toUserAmountA = $t02462825324._1
823- let toUserAmountB = $t02462825324._2
830+ let toUserAmountA = $t02470625402._1
831+ let toUserAmountB = $t02470625402._2
824832 $Tuple7(toUserAmountA, assetIdA, toUserAmountB, assetIdB, cBalAAfter, cBalBAfter, shareId)
825833 }
826834 else throw("Strict value is not equal to itself.")
827835 }
828836 else throw("Strict value is not equal to itself.")
829837 }
830838 else throw("Strict value is not equal to itself.")
831839 }
832840
833841
834842 func userCanWithdrawShareCalc (user,pool,posId,borrowed) = {
835843 let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position")
836844 let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest))
837845 let poolInterest = if (borrowed)
838846 then getIntegerValue(this, (pool + kPoolInterestLoan))
839847 else getIntegerValue(this, (pool + kPoolInterestNoLoan))
840848 (pAmount + fraction(pAmount, (poolInterest - userInterest), SCALE10))
841849 }
842850
843851
844852 func withdrawToUser (user,pool,posId,stopLoss) = {
845853 let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position")
846854 let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest))
847855 let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)), 0)
848856 let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0))
849857 let poolTotalShare = getPoolTotalShare(pool)
850858 let userAddr = Address(fromBase58String(user))
851859 let borrowAsset = valueOrElse(getString(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)), "")
852860 let debt = if ((borrowAmount > 0))
853861 then {
854862 let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((((pool + "_") + user) + "_") + posId), borrowAsset], nil)
855863 if ($isInstanceOf(@, "Int"))
856864 then @
857865 else throw(($getType(@) + " couldn't be cast to Int"))
858866 }
859867 else 0
860- let $t02683626989 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset)
861- if (($t02683626989 == $t02683626989))
868+ let $t02691427067 = withdrawAmountCalc(pool, userCanWithdraw, debt, borrowAsset)
869+ if (($t02691427067 == $t02691427067))
862870 then {
863- let shareId = $t02683626989._7
864- let cBalBAfter = $t02683626989._6
865- let cBalAAfter = $t02683626989._5
866- let assetIdB = $t02683626989._4
867- let toUserAmountB = $t02683626989._3
868- let assetIdA = $t02683626989._2
869- let toUserAmountA = $t02683626989._1
871+ let shareId = $t02691427067._7
872+ let cBalBAfter = $t02691427067._6
873+ let cBalAAfter = $t02691427067._5
874+ let assetIdB = $t02691427067._4
875+ let toUserAmountB = $t02691427067._3
876+ let assetIdA = $t02691427067._2
877+ let toUserAmountA = $t02691427067._1
870878 let closeDbtInv = if ((debt > 0))
871879 then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)])
872880 else 0
873881 if ((closeDbtInv == closeDbtInv))
874882 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))
875883 else throw("Strict value is not equal to itself.")
876884 }
877885 else throw("Strict value is not equal to itself.")
878886 }
879887
880888
881889 func parseRequest (requestId) = {
882890 let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",")
883891 let user = request[0]
884892 let pool = request[1]
885893 let pmtA = parseIntValue(request[2])
886894 let AId = request[3]
887895 let pmtB = parseIntValue(request[4])
888896 let BId = request[5]
889897 let balA = parseIntValue(request[6])
890898 let balB = parseIntValue(request[7])
891899 let shareId = request[8]
892900 let bwAsset = request[9]
893901 let bwAmount = parseIntValue(request[10])
894902 $Tuple11(user, pool, pmtA, AId, pmtB, BId, balA, balB, shareId, bwAsset, bwAmount)
895903 }
896904
897905
898906 func calcBorrowAmount (pmtA,pmtB,aId,bId,leverage,borrowId) = {
899907 let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [aId, false], nil)
900908 if ($isInstanceOf(@, "(Int, Int)"))
901909 then @
902910 else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2
903911 let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [bId, false], nil)
904912 if ($isInstanceOf(@, "(Int, Int)"))
905913 then @
906914 else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._2
907915 let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN)
908916 let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN)
909917 let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB))
910- let $t02867528772 = if ((borrowId == aId))
918+ let $t02875328850 = if ((borrowId == aId))
911919 then $Tuple2(dPriceA, decPrA)
912920 else $Tuple2(dPriceB, decPrB)
913- let borrowPrice = $t02867528772._1
914- let borrowDecPr = $t02867528772._2
921+ let borrowPrice = $t02875328850._1
922+ let borrowDecPr = $t02875328850._2
915923 fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice)
916924 }
917925
918926
919927 @Callable(i)
920928 func replenishEVALONLY (pool,leverage,borrowId,pmtA,pmtB) = if (if ((100 > leverage))
921929 then true
922930 else (leverage > 300))
923931 then throw("Leverage can't be <100 and >300")
924932 else {
925933 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
926- let $t02918429274 = getPoolData(Address(fromBase58String(pool)), pType)
927- let AId = $t02918429274._1
928- let BId = $t02918429274._2
929- let balA = $t02918429274._3
930- let balB = $t02918429274._4
931- let shareId = $t02918429274._5
934+ let $t02926229352 = getPoolData(Address(fromBase58String(pool)), pType)
935+ let AId = $t02926229352._1
936+ let BId = $t02926229352._2
937+ let balA = $t02926229352._3
938+ let balB = $t02926229352._4
939+ let shareId = $t02926229352._5
932940 let borrowAmount = if ((leverage > 100))
933941 then calcBorrowAmount(pmtA, pmtB, AId, BId, leverage, borrowId)
934942 else 0
935- let $t02940929516 = if ((borrowId == AId))
943+ let $t02948729594 = if ((borrowId == AId))
936944 then $Tuple2((pmtA + borrowAmount), pmtB)
937945 else $Tuple2(pmtA, (pmtB + borrowAmount))
938- let payInA = $t02940929516._1
939- let payInB = $t02940929516._2
946+ let payInA = $t02948729594._1
947+ let payInB = $t02948729594._2
940948 let lpAmount = calcReplenishLPVirt(pType, pool, payInA, AId, payInB, BId, balA, balB)
941949 let newBalA = (balA + payInA)
942950 let newBalB = (balB + payInB)
943- let $t02967329809 = calcWithdrawLPVirt(pType, pool, lpAmount, shareId, AId, BId, newBalA, newBalB, borrowAmount, borrowId)
944- if (($t02967329809 == $t02967329809))
951+ let $t02975129887 = calcWithdrawLPVirt(pType, pool, lpAmount, shareId, AId, BId, newBalA, newBalB, borrowAmount, borrowId)
952+ if (($t02975129887 == $t02975129887))
945953 then {
946- let amountGetB = $t02967329809._2
947- let amountGetA = $t02967329809._1
954+ let amountGetB = $t02975129887._2
955+ let amountGetA = $t02975129887._1
948956 let ratioBefore = fraction(balB, SCALE8, balA)
949957 let ratioAfter = fraction((newBalB - amountGetB), SCALE8, (newBalA - amountGetA))
950958 let impact = (SCALE8 - fraction(ratioBefore, SCALE8, ratioAfter))
951959 let impactMod = if ((0 > impact))
952960 then (impact * -1)
953961 else impact
954962 $Tuple2(nil, [amountGetA, amountGetB, impactMod])
955963 }
956964 else throw("Strict value is not equal to itself.")
957965 }
958966
959967
960968
961969 @Callable(i)
962970 func getShareAssetPriceREADONLY (shareId) = {
963- let sharePrices = getSharePrice([shareId])
964- $Tuple2(nil, sharePrices[0])
971+ let sharePrices = getSharePrice(shareId)
972+ $Tuple2(nil, sharePrices)
965973 }
966974
967975
968976
969977 @Callable(i)
970978 func getUserPositionShareAmountREADONLY (user,posNum) = {
971979 let pool = valueOrErrorMessage(getString(this, (((user + "_") + posNum) + kUserPositionPool)), "Unknown position")
972980 let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posNum) + kUserBorrowAmount))
973981 let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum, (borrowAmount > 0))
974982 $Tuple2(nil, userCanWithdraw)
975983 }
976984
977985
978986
979987 @Callable(i)
988+func getUserPositionInDollarsREADONLY (user,pools,posNum) = {
989+ func userPos (a,pool) = {
990+ let $t03092530959 = a
991+ let totalPos = $t03092530959._1
992+ let posDebt = $t03092530959._2
993+ let index = $t03092530959._3
994+ let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
995+ let $t03105131141 = getPoolData(Address(fromBase58String(pool)), pType)
996+ let AId = $t03105131141._1
997+ let BId = $t03105131141._2
998+ let balA = $t03105131141._3
999+ let balB = $t03105131141._4
1000+ let shareId = $t03105131141._5
1001+ let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0)
1002+ let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0))
1003+ let sharePrices = getSharePrice(shareId)
1004+ let decPrShare = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN)
1005+ let shareD = fraction(userCanWithdraw, sharePrices, decPrShare)
1006+ if ((borrowAmount == 0))
1007+ then $Tuple3((totalPos :+ shareD), (posDebt :+ 0), (index + 1))
1008+ else {
1009+ let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAssetId))
1010+ let debt = {
1011+ let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((((pool + "_") + user) + "_") + posNum[index]), borrowAsset], nil)
1012+ if ($isInstanceOf(@, "Int"))
1013+ then @
1014+ else throw(($getType(@) + " couldn't be cast to Int"))
1015+ }
1016+ let borrowAssetPrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [borrowAsset, false], nil)
1017+ if ($isInstanceOf(@, "(Int, Int)"))
1018+ then @
1019+ else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1
1020+ let decPrBorrowId = pow(10, 0, getAssetDecimals(borrowAsset), 0, 0, DOWN)
1021+ let debtD = fraction(debt, borrowAssetPrice, decPrBorrowId)
1022+ $Tuple3((totalPos :+ shareD), (posDebt :+ debtD), (index + 1))
1023+ }
1024+ }
1025+
1026+ let $t03219732252 = {
1027+ let $l = pools
1028+ let $s = size($l)
1029+ let $acc0 = $Tuple3(nil, nil, 0)
1030+ func $f0_1 ($a,$i) = if (($i >= $s))
1031+ then $a
1032+ else userPos($a, $l[$i])
1033+
1034+ func $f0_2 ($a,$i) = if (($i >= $s))
1035+ then $a
1036+ else throw("List size exceeds 20")
1037+
1038+ $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)
1039+ }
1040+ let pos = $t03219732252._1
1041+ let debt = $t03219732252._2
1042+ $Tuple2(nil, $Tuple2(pos, debt))
1043+ }
1044+
1045+
1046+
1047+@Callable(i)
9801048 func replenish (pool,leverage,borrowId) = if (if ((100 > leverage))
9811049 then true
9821050 else (leverage > 300))
9831051 then throw("Leverage can't be <100 and >300")
9841052 else {
9851053 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
986- let $t03095831048 = getPoolData(Address(fromBase58String(pool)), pType)
987- let AId = $t03095831048._1
988- let BId = $t03095831048._2
989- let balA = $t03095831048._3
990- let balB = $t03095831048._4
991- let shareId = $t03095831048._5
992- let $t03105131688 = if ((size(i.payments) == 2))
1054+ let $t03257532665 = getPoolData(Address(fromBase58String(pool)), pType)
1055+ let AId = $t03257532665._1
1056+ let BId = $t03257532665._2
1057+ let balA = $t03257532665._3
1058+ let balB = $t03257532665._4
1059+ let shareId = $t03257532665._5
1060+ let $t03266833305 = if ((size(i.payments) == 2))
9931061 then if ((assetIdToStr(i.payments[0].assetId) != AId))
9941062 then throw("Wrong payment asset A")
9951063 else if ((assetIdToStr(i.payments[1].assetId) != BId))
9961064 then throw("Wrong payment asset B")
9971065 else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId)
9981066 else if ((size(i.payments) == 1))
9991067 then if ((assetIdToStr(i.payments[0].assetId) == AId))
10001068 then $Tuple4(i.payments[0].amount, AId, 0, BId)
10011069 else if ((assetIdToStr(i.payments[0].assetId) == BId))
10021070 then $Tuple4(0, AId, i.payments[0].amount, BId)
10031071 else throw("Wrong payment")
10041072 else throw("One or two payments expected")
1005- let pmtA = $t03105131688._1
1006- let pmtAssetA = $t03105131688._2
1007- let pmtB = $t03105131688._3
1008- let pmtAssetB = $t03105131688._4
1073+ let pmtA = $t03266833305._1
1074+ let pmtAssetA = $t03266833305._2
1075+ let pmtB = $t03266833305._3
1076+ let pmtAssetB = $t03266833305._4
10091077 let newPosNum = getNewUserPositionNumber(pool, toString(i.caller))
10101078 if ((leverage > 100))
10111079 then {
10121080 let borrowAmount = calcBorrowAmount(pmtA, pmtB, pmtAssetA, pmtAssetB, leverage, borrowId)
10131081 let request = makeString([toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowId, toString(borrowAmount)], ",")
10141082 let newRequestId = {
10151083 let @ = invoke(this, "createNewRequest", [request], nil)
10161084 if ($isInstanceOf(@, "Int"))
10171085 then @
10181086 else throw(($getType(@) + " couldn't be cast to Int"))
10191087 }
10201088 if ((newRequestId == newRequestId))
10211089 then {
10221090 let args = [((toString(i.caller) + "_") + toString(newPosNum)), shareId, borrowId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))]
10231091 let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil)
10241092 if ((inv == inv))
10251093 then nil
10261094 else throw("Strict value is not equal to itself.")
10271095 }
10281096 else throw("Strict value is not equal to itself.")
10291097 }
10301098 else {
1031- let $t03262232734 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1032- let userStaked = $t03262232734._1
1033- let axlyFee = $t03262232734._2
1099+ let $t03423934351 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1100+ let userStaked = $t03423934351._1
1101+ let axlyFee = $t03423934351._2
10341102 (replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId))
10351103 }
10361104 }
10371105
10381106
10391107
10401108 @Callable(i)
10411109 func replenishFromLand (requestId) = {
1042- let $t03294533049 = parseRequest(requestId)
1043- let user = $t03294533049._1
1044- let pool = $t03294533049._2
1045- let pmtA = $t03294533049._3
1046- let AId = $t03294533049._4
1047- let pmtB = $t03294533049._5
1048- let BId = $t03294533049._6
1049- let balA = $t03294533049._7
1050- let balB = $t03294533049._8
1051- let shareId = $t03294533049._9
1052- let bwAsset = $t03294533049._10
1053- let bwAmount = $t03294533049._11
1110+ let $t03456234666 = parseRequest(requestId)
1111+ let user = $t03456234666._1
1112+ let pool = $t03456234666._2
1113+ let pmtA = $t03456234666._3
1114+ let AId = $t03456234666._4
1115+ let pmtB = $t03456234666._5
1116+ let BId = $t03456234666._6
1117+ let balA = $t03456234666._7
1118+ let balB = $t03456234666._8
1119+ let shareId = $t03456234666._9
1120+ let bwAsset = $t03456234666._10
1121+ let bwAmount = $t03456234666._11
10541122 if ((size(i.payments) != 1))
10551123 then throw("Wrong payment size")
10561124 else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset))
10571125 then true
10581126 else (i.payments[0].amount != bwAmount))
10591127 then throw("Wrong payment")
10601128 else {
1061- let $t03323933363 = if ((AId == bwAsset))
1129+ let $t03485634980 = if ((AId == bwAsset))
10621130 then $Tuple2((pmtA + i.payments[0].amount), pmtB)
10631131 else $Tuple2(pmtA, (pmtB + i.payments[0].amount))
1064- let pmtAllA = $t03323933363._1
1065- let pmtAllB = $t03323933363._2
1132+ let pmtAllA = $t03485634980._1
1133+ let pmtAllB = $t03485634980._2
10661134 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool")
1067- let $t03344533554 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1068- let userStaked = $t03344533554._1
1069- let axlyFee = $t03344533554._2
1135+ let $t03506235171 = replenishByType(pType, pool, LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1136+ let userStaked = $t03506235171._1
1137+ let axlyFee = $t03506235171._2
10701138 let posNum = getNewUserPositionNumber(pool, toString(i.caller))
10711139 let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)]
10721140 let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true)
10731141 $Tuple2((((entries ++ getCursEntries(AId, BId, shareId)) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked)
10741142 }
10751143 }
10761144
10771145
10781146
10791147 @Callable(i)
10801148 func withdraw (pool,posId) = withdrawToUser(toString(i.caller), pool, toString(posId), false)
10811149
10821150
10831151
10841152 @Callable(i)
10851153 func createUpdateStopLoss (posId,poolId,assetId,price) = {
10861154 let tokenOraclePrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil)
10871155 if ($isInstanceOf(@, "(Int, Int)"))
10881156 then @
10891157 else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1
10901158 if (!(isDefined(getInteger(this, (((((poolId + "_") + toString(i.caller)) + "_") + toString(posId)) + kUserPosition)))))
10911159 then throw("There are no user position")
10921160 else if ((0 >= price))
10931161 then throw("Price must be greater than 0")
10941162 else if ((price > tokenOraclePrice))
10951163 then throw("Price must be less than current token price")
10961164 else [IntegerEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss), price)]
10971165 }
10981166
10991167
11001168
11011169 @Callable(i)
11021170 func deleteStopLoss (posId,poolId,assetId) = if (!(isDefined(getInteger(this, (((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss)))))
11031171 then throw("No entry")
11041172 else [DeleteEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))]
11051173
11061174
11071175
11081176 @Callable(i)
11091177 func createNewRequest (params) = valueOrElse(isSelfCall(i), {
11101178 let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1)
11111179 $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId)
11121180 })
11131181
11141182
11151183
11161184 @Callable(i)
11171185 func stopLoss (user,posId,pool,assetId) = {
11181186 let tokenOraclePrice = ( let @ = invoke(priceOracleAddr, "getTWAP60", [assetId, false], nil)
11191187 if ($isInstanceOf(@, "(Int, Int)"))
11201188 then @
11211189 else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1
11221190 if (!(isDefined(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)))))
11231191 then throw("No entry")
11241192 else (withdrawToUser(toString(i.caller), pool, toString(posId), true) :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)))
11251193 }
11261194
11271195
11281196
11291197 @Callable(i)
11301198 func liquidate (user,posId,liquidateAmount) = {
11311199 let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position")
11321200 let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
1133- let $t03633736427 = getPoolData(Address(fromBase58String(pool)), pType)
1134- let AId = $t03633736427._1
1135- let BId = $t03633736427._2
1136- let balA = $t03633736427._3
1137- let balB = $t03633736427._4
1138- let shareId = $t03633736427._5
1201+ let $t03795438044 = getPoolData(Address(fromBase58String(pool)), pType)
1202+ let AId = $t03795438044._1
1203+ let BId = $t03795438044._2
1204+ let balA = $t03795438044._3
1205+ let balB = $t03795438044._4
1206+ let shareId = $t03795438044._5
11391207 let amount = unstakeLP(pool, pType, shareId, liquidateAmount)
11401208 let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount))
11411209 let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId))
11421210 let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0))
11431211 if ((borrowAmount == 0))
11441212 then throw("You can't liquidate position without borrow")
11451213 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))]
11461214 }
11471215
11481216
11491217
11501218 @Callable(i)
11511219 func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = {
1152- let $t03766237856 = if (claim)
1220+ let $t03927939473 = if (claim)
11531221 then claimFarmed(type, pool)
11541222 else {
11551223 let claimedAsset = if ((type == SF_POOL))
11561224 then SWOPID
11571225 else WXID
11581226 $Tuple2(amountToExchange, claimedAsset)
11591227 }
1160- let claimedAmount = $t03766237856._1
1161- let claimedAsset = $t03766237856._2
1228+ let claimedAmount = $t03927939473._1
1229+ let claimedAsset = $t03927939473._2
11621230 let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options)
11631231 let change = (claimedAmount - amountToExchange)
11641232 let changeEntry = if ((change > 0))
11651233 then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))]
11661234 else nil
11671235 (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry)
11681236 }
11691237
11701238
11711239
11721240 @Callable(i)
11731241 func capitalizeExPuzzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = {
1174- let $t03851338707 = if (claim)
1242+ let $t04013040324 = if (claim)
11751243 then claimFarmed(type, pool)
11761244 else {
11771245 let claimedAsset = if ((type == SF_POOL))
11781246 then SWOPID
11791247 else WXID
11801248 $Tuple2(amountToExchange, claimedAsset)
11811249 }
1182- let claimedAmount = $t03851338707._1
1183- let claimedAsset = $t03851338707._2
1250+ let claimedAmount = $t04013040324._1
1251+ let claimedAsset = $t04013040324._2
11841252 let exchangedAmount = exchangePuzzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options)
11851253 let change = (claimedAmount - amountToExchange)
11861254 let changeEntry = if ((change > 0))
11871255 then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))]
11881256 else nil
11891257 (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry)
11901258 }
11911259
11921260
11931261
11941262 @Callable(i)
11951263 func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = {
1196- let $t03943039624 = if (claim)
1264+ let $t04104741241 = if (claim)
11971265 then claimFarmed(type, pool)
11981266 else {
11991267 let claimedAsset = if ((type == SF_POOL))
12001268 then SWOPID
12011269 else WXID
12021270 $Tuple2(amountToExchange, claimedAsset)
12031271 }
1204- let claimedAmount = $t03943039624._1
1205- let claimedAsset = $t03943039624._2
1272+ let claimedAmount = $t04104741241._1
1273+ let claimedAsset = $t04104741241._2
12061274 let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options)
12071275 let change = (claimedAmount - amountToExchange)
12081276 let changeEntry = if ((change > 0))
12091277 then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))]
12101278 else nil
12111279 (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry)
12121280 }
12131281
12141282
12151283
12161284 @Callable(i)
12171285 func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan,stoplossFeeNoLoan,stoplossFeeWithLoan) = if (if ((type != SF_POOL))
12181286 then (type != WX_POOL)
12191287 else false)
12201288 then throw("Wrong type")
12211289 else {
1222- let $t04031740411 = getPoolData(Address(fromBase58String(poolAddr)), type)
1223- let aId = $t04031740411._1
1224- let bId = $t04031740411._2
1225- let aBal = $t04031740411._3
1226- let bBal = $t04031740411._4
1227- let shareId = $t04031740411._5
1290+ let $t04193442028 = getPoolData(Address(fromBase58String(poolAddr)), type)
1291+ let aId = $t04193442028._1
1292+ let bId = $t04193442028._2
1293+ let aBal = $t04193442028._3
1294+ let bBal = $t04193442028._4
1295+ let shareId = $t04193442028._5
12281296 [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)]
12291297 }
12301298
12311299
12321300
12331301 @Callable(i)
12341302 func capitalizeTest (pool,pType,tokenId,tokenAmount) = {
12351303 let poolAddr = Address(fromBase58String(pool))
1236- let $t04120741286 = getPoolData(poolAddr, pType)
1237- let AId = $t04120741286._1
1238- let BId = $t04120741286._2
1239- let balA = $t04120741286._3
1240- let balB = $t04120741286._4
1241- let shareId = $t04120741286._5
1242- let $t04128941369 = if ((tokenId == AId))
1304+ let $t04282442903 = getPoolData(poolAddr, pType)
1305+ let AId = $t04282442903._1
1306+ let BId = $t04282442903._2
1307+ let balA = $t04282442903._3
1308+ let balB = $t04282442903._4
1309+ let shareId = $t04282442903._5
1310+ let $t04290642986 = if ((tokenId == AId))
12431311 then $Tuple2(tokenAmount, 0)
12441312 else $Tuple2(0, tokenAmount)
1245- let pmtA = $t04128941369._1
1246- let pmtB = $t04128941369._2
1247- let $t04137241476 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1248- let stakedAmount = $t04137241476._1
1249- let nf = $t04137241476._2
1313+ let pmtA = $t04290642986._1
1314+ let pmtB = $t04290642986._2
1315+ let $t04298943093 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId)
1316+ let stakedAmount = $t04298943093._1
1317+ let nf = $t04298943093._2
12501318 let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0)
12511319 let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0)
12521320 let totalShareAmount = getPoolTotalShare(pool)
12531321 let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool)
12541322 let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount)
12551323 let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8)
12561324 let stakedNoLoan = (stakedAmount - stakedLoan)
12571325 let newInterestLoan = if ((totalShareAmountWithLoan > 0))
12581326 then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan))
12591327 else 0
12601328 let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0))
12611329 then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan)))
12621330 else 0
12631331 let axlyFeeLoan = fraction(stakedLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6)
12641332 let axlyFeeNoLoan = fraction(stakedNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6)
12651333 let axlyFee = unstakeLP(pool, pType, shareId, (axlyFeeLoan + axlyFeeNoLoan))
12661334 if ((axlyFee == axlyFee))
12671335 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))
12681336 else throw("Strict value is not equal to itself.")
12691337 }
12701338
12711339
12721340
12731341 @Callable(i)
12741342 func claimFarmedTest (type,pool) = if ((type == SF_POOL))
12751343 then {
12761344 let balBefore = accountBalance(SWOPID)
12771345 if ((balBefore == balBefore))
12781346 then {
12791347 let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil)
12801348 if ((inv == inv))
12811349 then {
12821350 let balAfter = accountBalance(SWOPID)
12831351 $Tuple2(nil, $Tuple2((balAfter - balBefore), SWOPID))
12841352 }
12851353 else throw("Strict value is not equal to itself.")
12861354 }
12871355 else throw("Strict value is not equal to itself.")
12881356 }
12891357 else if ((type == WX_POOL))
12901358 then {
12911359 let balBefore = accountBalance(WXID)
12921360 if ((balBefore == balBefore))
12931361 then {
12941362 let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil)
12951363 if ((inv == inv))
12961364 then {
12971365 let balAfter = accountBalance(WXID)
12981366 $Tuple2(nil, $Tuple2((balAfter - balBefore), WXID))
12991367 }
13001368 else throw("Strict value is not equal to itself.")
13011369 }
13021370 else throw("Strict value is not equal to itself.")
13031371 }
13041372 else throw("Wrong pool type")
13051373
13061374
13071375 @Verifier(tx)
13081376 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
13091377

github/deemru/w8io/026f985 
214.63 ms