Skip to content

fix(api): route sell quotes to settlement chains - #1304

Merged
ebma merged 5 commits into
stagingfrom
codex/fix-sell-quotes-without-moonbeam
Aug 3, 2026
Merged

fix(api): route sell quotes to settlement chains#1304
ebma merged 5 commits into
stagingfrom
codex/fix-sell-quotes-without-moonbeam

Conversation

@ebma

@ebma ebma commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

  • route SELL quote simulation to the requested Base or Polygon settlement chain instead of the legacy Moonbeam post-hook
  • align Squid quote topology with current offramp transaction preparation
  • add nightly deployed BUY and SELL quote smoke tests against staging and production through a cross-chain Squid corridor
  • single-flight dashboard token refreshes so proactive refresh and callback 401 recovery cannot race refresh-token rotation
  • pin the dashboard Playwright widget origin so its journeys are hermetic

Testing

  • phase-block API suite: 186 passed, 3 skipped
  • dashboard unit suite: 72 passed
  • dashboard Playwright suite: 64 passed
  • API and dashboard typechecks
  • Biome, Prettier, and workflow YAML checks
  • deployed smoke detector manually confirmed: BUY passes on staging and production; SELL reports the current HTTP 500 on both until this hotfix is deployed

Scope

The quote hotfix removes legacy Moonbeam routing from quote creation. The separate moonbeamCleanup background-processing failure is not changed here.

@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 71b992b
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/6a70bdd1d7522200086da63e
😎 Deploy Preview https://deploy-preview-1304--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit 71b992b
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/6a70bdd142a3e2000851aa59
😎 Deploy Preview https://deploy-preview-1304--vortexfi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for vrtx-dashboard ready!

Name Link
🔨 Latest commit 71b992b
🔍 Latest deploy log https://app.netlify.com/projects/vrtx-dashboard/deploys/6a70bdd18bc43600087bcbc8
😎 Deploy Preview https://deploy-preview-1304--vrtx-dashboard.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@ebma

ebma commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

Code review

Found 1 issue:

  1. rampType is left orphaned on EvmBridgeRequest and EvmBridgeQuoteRequest. This PR removes the only reads of the field (the BUY/SELL branch in the old prepareSquidrouterRouteParams and the destructure in calculateEvmBridgeAndNetworkFee), but the field remains declared as required on both interfaces, RampDirection stays imported solely to type it, and callers (evm-offramp-source/simulation.ts, alfredpay-offramp/simulation.ts, mykobo-mint/simulation.ts, squid-router-swap/simulation.ts) still construct and pass it to no effect (CLAUDE.md says "When your changes create orphans: Remove imports/variables/functions that YOUR changes made unused")

originalInputAmountForRateCalc: string; // The inputAmountForSwap that went into Nabla, for final rate calculation
rampType: RampDirection; // Whether this is an onramp or offramp
}
export interface EvmBridgeQuoteRequest {
rampType: RampDirection; // Whether this is an onramp or offramp
amountDecimal: string; // Raw amount

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Aligns SELL quote simulation with actual EVM settlement routes while improving deployed smoke coverage and dashboard test reliability.

Changes:

  • Replaces legacy Moonbeam quote routing with Base/Polygon-aware Squid routes.
  • Adds nightly deployed BUY/SELL quote smoke tests.
  • Coalesces dashboard token refreshes and pins the E2E widget origin.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/e2e.yml Runs deployed quote smoke tests nightly.
docs/operations-testing.md Documents deployed smoke coverage.
apps/dashboard/playwright.config.ts Pins the mocked widget origin.
apps/dashboard/src/services/auth.ts Adds shared in-flight token refreshes.
apps/dashboard/src/services/auth.test.ts Tests concurrent refresh coalescing.
apps/api/src/tests/deployed-quotes.e2e.test.ts Probes deployed BUY/SELL quotes.
apps/api/src/api/services/phases/blocks/core/squidrouter.ts Uses direction-independent quote routes.
apps/api/src/api/services/phases/blocks/core/squidrouter-route.ts Builds generic simulation routes.
apps/api/src/api/services/phases/blocks/__tests__/squidrouter-quote-route.test.ts Verifies Base and Polygon settlement routing.
apps/api/src/api/services/phases/blocks/__tests__/onramp-discount.test.ts Updates expected bridge request shape.
apps/api/src/api/services/phases/blocks/phases/subsidize-post/simulation.ts Removes obsolete ramp direction.
apps/api/src/api/services/phases/blocks/phases/squid-router-swap/simulation.ts Updates bridge simulation input.
apps/api/src/api/services/phases/blocks/phases/mykobo-mint/simulation.ts Updates Mykobo bridge simulation.
apps/api/src/api/services/phases/blocks/phases/evm-offramp-source/simulation.ts Routes SELL simulation to Base.
apps/api/src/api/services/phases/blocks/phases/avenia-mint/index.ts Updates Avenia bridge quoting.
apps/api/src/api/services/phases/blocks/phases/alfredpay-offramp/simulation.ts Routes Alfredpay simulation to Polygon.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/api/src/api/services/phases/blocks/phases/alfredpay-offramp/simulation.ts Outdated
Comment thread apps/dashboard/src/services/auth.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

.github/workflows/e2e.yml:70

  • This adds a non-Playwright failure source, but the downstream Slack alert still says “Nightly Playwright e2e run failed.” When only the deployed quote probe fails, responders receive a misleading diagnosis. Broaden the notification text to mention the e2e/smoke workflow.
      - name: 🩺 Live BUY/SELL quote smoke tests

Comment thread apps/dashboard/src/services/auth.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

@ebma
ebma merged commit f13c02a into staging Aug 3, 2026
7 checks passed
@ebma
ebma deleted the codex/fix-sell-quotes-without-moonbeam branch August 3, 2026 16:20
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