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