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

Enable Forex AMM on Pendulum #569

Merged
merged 11 commits into from
Oct 9, 2024
Merged

Enable Forex AMM on Pendulum #569

merged 11 commits into from
Oct 9, 2024

Conversation

Sharqiewicz
Copy link
Collaborator

@Sharqiewicz Sharqiewicz commented Sep 30, 2024

⭐ New menu option available: ForexAMM ⭐

Copy link

netlify bot commented Sep 30, 2024

Deploy Preview for rococo-souffle-a625f5 ready!

Name Link
🔨 Latest commit 88a4e64
🔍 Latest deploy log https://app.netlify.com/sites/rococo-souffle-a625f5/deploys/670666ec6069010008f40a35
😎 Deploy Preview https://deploy-preview-569--rococo-souffle-a625f5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ebma ebma changed the title enable forexamm for pendulum Enable Forex AMM on Pendulum Oct 1, 2024
Copy link
Member

@TorstenStueber TorstenStueber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@prayagd
Copy link
Collaborator

prayagd commented Oct 3, 2024

@Sharqiewicz Listing down things that were discovered while testing

  • Expanding the details section on swap screen does not work, it just increases the font size. I have attached a screenshot on how it should look like
  • Update the "Powered by Vortex finance" hyperlink to vortexfinance.co
  • Add icon's before the name of the asset on the swap pool column
Screenshot 2024-05-16 at 11 44 03 AM

@prayagd
Copy link
Collaborator

prayagd commented Oct 3, 2024

  • Currently on swap screen after entering a number in the input field it shows the price of the asset, Please change it to the amount based on user's input for example user enters 0.5 for DOT and the price is $4.04, then it should be 0.5*4.04 = $2.02, it should be done for both fields. Please let me know if not clear.

image

@prayagd
Copy link
Collaborator

prayagd commented Oct 4, 2024

@pendulum-chain/devs The Deposit in the backstop pool is not working, can you please check
image

@ebma
Copy link
Member

ebma commented Oct 4, 2024

Update the "Powered by Vortex finance" hyperlink to vortexfinance.co

@prayagd shouldn't it rather be 'Update the "Powered by Vortex finance" text to "Powered by Nabla finance"'? It's not powered by vortex but by Nabla so the link is correct.

the Deposit in the backstop pool is not working, can you please check

Which amount did you use? And can you please also share a screenshot of the console logs of your developer console next time? Even if we are able to reproduce a similar issue, the logs are helpful in any case to rule out temporary problems or issues that only happen in some circumstances.

@vadaynujra
Copy link

@ebma following agreement of terms with Nabla team, we are now allowed to call it powered by Vortex Finannce and therefore also link it to the Vortex Finance website.

@ebma
Copy link
Member

ebma commented Oct 4, 2024

Okay but it doesn't make sense, does it? It would need to be called "Powering Vortex finance" if anything. It has nothing to do with Vortex?

@prayagd
Copy link
Collaborator

prayagd commented Oct 4, 2024

Which amount did you use? And can you please also share a screenshot of the console logs of your developer console next time? Even if we are able to reproduce a similar issue, the logs are helpful in any case to rule out temporary problems or issues that only happen in some circumstances.

i tired amounts of 2 USDC, 4 USDC and 8 USDC. There was nothing in the console log, i checked

@TorstenStueber
Copy link
Member

@prayagd what swap direction did you use? USDC to EURC or DOT?

@TorstenStueber
Copy link
Member

@prayagd I checked the problem with the backstop pool. There are two issues: 1) we don't properly show an error message and 2) the error actually happening here is that the value of each backstop pool token in this configuration is negative and therefore it is not possible to charge the backstop pool.

The value of a pool token is calculated as the sum of

  • the amount tokens in the backstop pool (which is 0)
  • for each swap pool: the "excess liquidity" of the swap pool price converted to the backstop pool token

The excess liquidity of each swap pool is

  • EURC: -1.159, convered to USD: -1.28 USD
  • DOT: 0.2, converted to USD: 0.83 USD
  • USDC.axl: 0
  • USDC: 0

So the total worth is -1.28 + 0.83 = -0.45 USD is negative.

Why did it happen

This can usually only happen initially if the backstop pool does not contain any significant amount of tokens yet and there was a trade and after that a price shift.

How to resolve

To resolve just transfer, e.g., 1 EURC to the address of the EURC swap pool (6g2pcZdxWKQjF36Mb5ebEDAx2NRw2zSYv82Vwa93yz3mzbbR), no deposit, just normal transfer. After that you can charge the backstop pool.

@prayagd
Copy link
Collaborator

prayagd commented Oct 4, 2024

@prayagd what swap direction did you use? USDC to EURC or DOT?

DOT to EURC.s

@prayagd
Copy link
Collaborator

prayagd commented Oct 4, 2024

@TorstenStueber Thanks, the transfer worked

@Sharqiewicz
Copy link
Collaborator Author

Expanding the details section on swap screen does not work, it just increases the font size. I have attached a screenshot on how it should look like
Update the "Powered by Vortex finance" hyperlink to vortexfinance.co
Add icon's before the name of the asset on the swap pool column

@prayagd Implemented 🦈

Currently on swap screen after entering a number in the input field it shows the price of the asset, Please change it to the amount based on user's input for example user enters 0.5 for DOT and the price is $4.04, then it should be 0.5*4.04 = $2.02, it should be done for both fields. Please let me know if not clear.

In Progress 🦈

@Sharqiewicz
Copy link
Collaborator Author

@prayagd Ready 🦈🟢 Please review 🥺

Copy link
Member

@TorstenStueber TorstenStueber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few comments regarding the use of number instead of big number formats. It's just good practice that we use big numbers as some of the assets can have many decimals (e.g., 18) and precision will be lost.

src/components/nabla/Swap/To.tsx Outdated Show resolved Hide resolved
src/components/nabla/common/NablaTokenPrice.tsx Outdated Show resolved Hide resolved
src/components/nabla/common/NablaTokenPrice.tsx Outdated Show resolved Hide resolved
src/components/nabla/Swap/From.tsx Outdated Show resolved Hide resolved
@vadaynujra
Copy link

@Sharqiewicz I just realised we don't show the limit / cap anywhere to the user. Is that something we should add in?

@vadaynujra
Copy link

Reference from Nabla
image

@Sharqiewicz
Copy link
Collaborator Author

@TorstenStueber Do you think we should add "Cap" to the "Liabilities" column?

@TorstenStueber
Copy link
Member

@Sharqiewicz @vadaynujra I would generally think that we should have these conversations within the ticket before someone picks it up. Nevertheless, what is the definition of the Cap?

@vadaynujra
Copy link

vadaynujra commented Oct 9, 2024

@TorstenStueber limits on swap pools and bsp.

@vadaynujra
Copy link

Also, will the Forex AMM link mention Nabla like it does on Foucoco? Please ensure we change to Forex instead of Nabla.

@TorstenStueber
Copy link
Member

Let's move this discussion to the ticket where we already discuss table captions: #474

Copy link
Collaborator

@prayagd prayagd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming that all the bugs that were raised are now fixed and working

@Sharqiewicz Sharqiewicz merged commit ce7f8ca into main Oct 9, 2024
5 checks passed
@Sharqiewicz Sharqiewicz deleted the enable-forexamm-pendulum branch October 9, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants