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