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

perf: improve tradeQuoteSlice selectors #7560

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Conversation

0xApotheosis
Copy link
Contributor

Description

Improves:

  • Performance by using selectors not reactive on global state
  • Consumer and runtime safety by ensuring args are correctly typed via a new selectRequiredParamFromFilter helper that ensures all necessary args are provided to the selector

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)

Resolves feedback on a previous PR: #7551 (comment)

Risk

Medium - only type and reactivity changes, though relates to some trade status functionality

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

Ensure allowance approvals and trade states behave as expected.

Testing

A general sanity check of the swapper and it's trade execution states.

Engineering

☝️

Operations

  • 🏁 My feature is behind a flag and doesn't require operations testing (yet)

☝️

Screenshots (if applicable)

N/A

@0xApotheosis 0xApotheosis requested a review from a team as a code owner August 18, 2024 23:25
@0xApotheosis 0xApotheosis mentioned this pull request Aug 18, 2024
4 tasks
@gomesalexandre gomesalexandre self-requested a review August 19, 2024 20:21
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.

One q. and one nitpick comment to reply to/tackle at your discretion, but happy to get this and confirmed happy at runtime! Much cleaner and performant 💜

Swapper sanity check:

https://jam.dev/c/58575f7e-0802-4aa5-9401-b0c2b0f8a6ee

@0xApotheosis 0xApotheosis merged commit a4aba6d into develop Aug 21, 2024
3 checks passed
@0xApotheosis 0xApotheosis deleted the improve-selectors branch August 21, 2024 02:20
gomesalexandre added a commit that referenced this pull request Aug 21, 2024
* chore: improve tradeQuoteSlice selectors

* chore: rename filters

---------

Co-authored-by: gomes <[email protected]>
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