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

fix: use correct account id for matching buy account #6263

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

kaladinlight
Copy link
Contributor

@kaladinlight kaladinlight commented Feb 20, 2024

Description

Do not use the sellAssetAccountId for deriving buyAccountId, but instead derive maybeMatchingBuyAccountId using the same account number as the sell asset. This ensures we use the correct matching accountId for the buy asset and are able to generate a receive address and subsequently trade quotes.

Regression: #6229

Follow up issue: #6262

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)

N/A - prod issue

Risk

High Risk PRs Require 2 approvals

Medium - logic changes what buy account is used for the trade

What protocols, transaction types or contract interactions might be affected by this PR?

All trades

Testing

  • Ensure you can now get quotes for cross chain swaps

Engineering

☝️

Operations

☝️

Screenshots (if applicable)

@kaladinlight kaladinlight requested a review from a team as a code owner February 20, 2024 17:32
@kaladinlight kaladinlight changed the title fix: use correct chain id for matching buy account fix: use correct account id for matching buy account Feb 20, 2024
@gomesalexandre gomesalexandre self-requested a review February 20, 2024 17:57
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 locally:

  • Matching account selection is sad again, though this isn't the guts of this PR fixing cross-chain trades:
image image
  • Cross-chain quotes are happy again
image

@kaladinlight kaladinlight merged commit 6b50fb5 into develop Feb 20, 2024
3 checks passed
@kaladinlight kaladinlight deleted the fix-use-receive-address branch February 20, 2024 18:38
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.

2 participants