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

chore: remove manual memo calcs #5094

Merged
merged 8 commits into from
Aug 18, 2023

Conversation

0xApotheosis
Copy link
Contributor

@0xApotheosis 0xApotheosis commented Aug 17, 2023

Description

Use the memo value given to us by thorchain/swap/quote - there is no need to calculate it ourselves so long as we are providing the correct input data when fetching the quote.

Things still to check:

  • Slippage input amount when hitting the GET request
  • Refund handling for small swaps - we might need client-side logic to handle what was previously a swapper concern

Pull Request Type

  • 🐛 Bug fix (Non-breaking Change: Fixes an issue)
  • 🛠️ Chore (Non-breaking Change: Doc updates, pkg upgrades, typos, etc..)
  • 💅 New Feature (Breaking/Non-breaking Change)

Issue (if applicable)

Assists with the Swapper SDK work by simplifying the input data needed to fetch a quote.

Risk

High - a bug with a THORSwap memo can lead to a total loss of trade funds. Test accordingly.

Testing

Check:

  • We still get THORSwap quotes as expected

Engineering

Check:

  • The memo returned from the thorchain/swap/quote endpoint matches what we expect (compare with that on prod if necessary with some inline debugging)

Operations

Check:

  • THORSwap trades complete as expected, which a memo that matches expectations

Screenshots (if applicable)

N/A

@0xApotheosis
Copy link
Contributor Author

0xApotheosis commented Aug 17, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Copy link
Member

@woodenfurniture woodenfurniture left a comment

Choose a reason for hiding this comment

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

amazing, you legend

@0xApotheosis 0xApotheosis force-pushed the 08-17-chore_remove_manual_memo_calcs branch from ff5533f to c328f23 Compare August 18, 2023 03:28
@0xApotheosis 0xApotheosis marked this pull request as ready for review August 18, 2023 09:20
@0xApotheosis 0xApotheosis requested a review from a team as a code owner August 18, 2023 09:20
@0xApotheosis
Copy link
Contributor Author

This one could do with some good ol' fashioned @gomesalexandre scrutiny.

Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

First pass, looking very good to me according to the updated test cases - functional pass to follow before making this purple

Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

Tested against prod with RUNE <-> ATOM and RUNE -> DOGE:

RUNE <-> ATOM

  • "You Get" amount is showing no regressions against prod
image image
  • Memo is looking good against prod
image image

And limit is slightly higher too 🎉

  • Trade is going through
image

RUNE -> DOGE

  • "You Get" amount is showing no regressions against prod
image image

Note how we get slightly more here 🎉

  • Memo is looking good against prod
image image
  • Trade is going through
image

Notice how the receive amount is now higher, as a result of the higher limit 🎉

@gomesalexandre gomesalexandre enabled auto-merge (squash) August 18, 2023 11:59
@gomesalexandre gomesalexandre merged commit c4e178f into develop Aug 18, 2023
3 checks passed
@gomesalexandre gomesalexandre deleted the 08-17-chore_remove_manual_memo_calcs branch August 18, 2023 11:59
This was referenced Aug 21, 2023
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.

3 participants