Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Earn Liquidity Pool #729

Open
Senna46 opened this issue Jan 25, 2024 · 0 comments
Open

Support Earn Liquidity Pool #729

Senna46 opened this issue Jan 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Senna46
Copy link
Contributor

Senna46 commented Jan 25, 2024

The current IRS backend is NOT able to support the Liquidity Pool of Earn

TODO implements the following logic

Deposit (Earn)

Estimate

The calculations are quite difficult and may not be realized.

  1. Calculate how many PTs should be swaped from inputUT (backend)
  2. Calculate and return the number of LPs that can be issued with the swaped PT and remaining UT (backend)

Tx

If the query is realized, it can be created.

  1. Calculate 1 in Estimate again to find the number of UTs to be converted.
  2. Execute SwapInPool and swap to PT.
  3. Use remaining UT & swapped PT to DepositToPool

Withdraw (Earn)

Estimate

not difficult

  1. Get LP => UT & PT (Existing querie)
  2. Get PT => UT (Existing querie)
  3. Display 1 + 2 UT value

Tx

With the current implementation, it needs two Tx's and the frontend cannot support it considering the waiting time for the first Tx.
We should create a Msg that combines the two Tx.

  1. LP => UT & PT
  2. PT => UT
@Senna46 Senna46 added the enhancement New feature or request label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant