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