Skip to content

feat(STX-575): add has_sufficient_gas_for_quote to quote received event#8895

Open
rarquevaux wants to merge 1 commit into
mainfrom
feat/STX-575-gasless-counter-metrics
Open

feat(STX-575): add has_sufficient_gas_for_quote to quote received event#8895
rarquevaux wants to merge 1 commit into
mainfrom
feat/STX-575-gasless-counter-metrics

Conversation

@rarquevaux
Copy link
Copy Markdown
Contributor

@rarquevaux rarquevaux commented May 26, 2026

Explanation

Add optional has_sufficient_gas_for_quote property to QuotesReceived event and getQuotesReceivedProperties utility to allow clients to pass whether the user has sufficient gas to submit the quote.

Context: https://docs.google.com/document/d/1EFG4E-5_U8DPAcxWFtNbemgB4e5e22pXxIFx5Pf37n8/edit?tab=t.0

This property will allow us to measure the perception of the user that they have enough native assets to cover the gas, but are presented incorrectly with a gasless swap quote

Why not using the warnings as a warning is added when the user has insufficient gas for quote. The warning is not emitted in the case of a gasIncluded quote. Adding the warning when it is not shown to the user for the quote would break the semantic of the existing warning property.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Backward-compatible optional analytics field and helper parameter; no swap/bridge execution or auth logic changes.

Overview
Adds an optional has_sufficient_gas_for_quote field to unified swap/bridge QuotesReceived analytics so clients can report whether the user has enough native gas to submit the active quote—separate from existing warnings, which do not cover gasless (gasIncluded) quotes cleanly.

getQuotesReceivedProperties gains a sixth optional argument; the property is included in the payload only when that argument is not undefined (same pattern as usd_balance_source). RequiredEventContextFromClient for QuotesReceived is updated accordingly, and the change is noted in CHANGELOG.md.

Reviewed by Cursor Bugbot for commit 11b7aa6. Bugbot is set up for automated code reviews on this repo. Configure here.

@rarquevaux rarquevaux requested review from a team as code owners May 26, 2026 14:53
@rarquevaux rarquevaux deployed to default-branch May 26, 2026 14:53 — with GitHub Actions Active
@rarquevaux rarquevaux force-pushed the feat/STX-575-gasless-counter-metrics branch from ae0535b to 5ee2ada Compare May 26, 2026 14:56
@rarquevaux rarquevaux force-pushed the feat/STX-575-gasless-counter-metrics branch from 5ee2ada to 11b7aa6 Compare May 26, 2026 15:16
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.

1 participant