Skip to content

feat: support Hyperliquid USDC deposits through Relay - #4137

Open
ChiTimesChi wants to merge 6 commits into
masterfrom
codex/hyperliquid-relay-deposits
Open

ChiTimesChi wants to merge 6 commits into
masterfrom
codex/hyperliquid-relay-deposits

Conversation

@ChiTimesChi

@ChiTimesChi ChiTimesChi commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • Route USDC deposits to Hyperliquid HyperCore perps through Relay in the SDK and synapse-interface, using Relay's existing source-token handling and honoring a custom recipient.
  • Remove the legacy two-step Arbitrum deposit UI and Bridge2 path. Remove its fixed 5 USDC frontend minimum.
  • Migrate persisted legacy deposit records out of pending activity while preserving other transaction history.

Validation

  • SDK and synapse-interface TypeScript checks pass.
  • Focused SDK Relay tests (3) and interface transaction/migration tests (5) pass.
  • Local FE quoted a 4 USDC Base → Hyperliquid USDC deposit through Relay, below the former frontend minimum.

Additional context

  • A 1 USDC Base → Hyperliquid attempt currently returned no Relay route; the frontend no longer applies a separate minimum.
  • Local ESLint is blocked by the repository's eslint-plugin-prettier / ESLint API mismatch (context.getPhysicalFilename is not a function).

Summary by CodeRabbit

  • New Features

    • USDC deposits to Hyperliquid Perps are now available through Relay from supported origin chains. Quotes display destination amounts with 8-decimal precision, and you can specify the recipient address.
    • USDC is available as a destination token from supported Relay origins.
  • Improvements

    • Transaction history reflects Relay deposit statuses more accurately. Existing saved data is migrated, with matching legacy deposits removed from transaction lists.
    • Destination address confirmation and quote errors are displayed consistently for USDC deposits.

f43c8ad: synapse-interface preview link
01d5bd3: synapse-interface preview link
a013bca: synapse-interface preview link

@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sanguine Error Error Sep 23, 2026 10:04pm UTC

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: synapsecns/sanguine/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 404ff978-7ed6-4c4d-a91e-9c0bbc001397

📥 Commits

Reviewing files that changed from the base of the PR and between 01c5d84 and 44b0f25.

📒 Files selected for processing (1)
  • packages/synapse-interface/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/synapse-interface/README.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The SDK router now supports Relay quotes for HyperCore USDC. The interface advertises the destination for Relay-supported origins and uses the standard bridge flow. It removes the former Arbitrum deposit flow and migrates matching legacy transactions from persisted state.

Changes

HyperCore USDC Relay bridging

Layer / File(s) Summary
SDK Relay routing and token metadata
packages/sdk-router/src/constants/addresses.ts, packages/sdk-router/src/relay/relayModuleSet.ts, packages/sdk-router/src/utils/TokenMetadataFetcher.ts, packages/sdk-router/src/relay/relayModuleSet.test.ts, packages/sdk-router/README.md
The router registers HyperCore with Relay and uses its zero-address USDC identifier for destination quotes. Token metadata reports 8 decimals. Tests cover candidate selection, quote construction, calldata, and transaction status. The README describes the route and its requirements.
Interface USDC route configuration
packages/synapse-interface/constants/tokens/bridgeable.ts, packages/synapse-interface/constants/bridgeMap.ts, packages/synapse-interface/constants/existingBridgeRoutes.ts, packages/synapse-interface/__tests__/synBridgeRoutes.test.ts, packages/synapse-interface/README.md, packages/synapse-interface/scripts/checkRpcHealth.js
The interface adds HyperCore USDC metadata and advertises the destination for Relay-supported origin chains. Route tests and documentation reflect Relay routing. The chain 1337 RPC health comment now describes HyperCore as a virtual chain.
Bridge flow and transaction tracking
packages/synapse-interface/pages/state-managed-bridge/index.tsx, packages/synapse-interface/components/StateManagedBridge/*, packages/synapse-interface/components/_Transaction/_Transactions.tsx, packages/synapse-interface/components/HyperliquidDepositInfo.tsx, packages/synapse-interface/components/StateManagedBridge/HyperliquidDepositButton.tsx, packages/synapse-interface/utils/*, packages/synapse-interface/utils/hyperliquid.ts, packages/synapse-interface/constants/index.ts, packages/synapse-interface/__tests__/*
The bridge page uses the selected destination chain and address for quotes, screening, analytics, and pending transaction records. The dedicated Arbitrum deposit button, status panel, and Hyperliquid-specific checks are removed. Standard address validation, output amounts, transaction status, and timestamp handling apply.
Persisted transaction migration
packages/synapse-interface/store/migrations.ts, packages/synapse-interface/store/reducer.ts, packages/synapse-interface/store/store.ts, packages/synapse-interface/__tests__/persistedTransactionsMigration.test.ts
Persistence advances to version 4 and runs a migration that removes matching legacy deposits from pending and historical transaction lists. Other state and transactions are retained, and the migration test covers those cases.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant bridgeV2
  participant RelayModuleSet
  participant relayApi
  bridgeV2->>RelayModuleSet: Request a HyperCore USDC route
  RelayModuleSet->>relayApi: Request a quote with the destination currency and recipient
  relayApi-->>RelayModuleSet: Return quote and deposit transaction step
  RelayModuleSet-->>bridgeV2: Return route amounts and deposit calldata
Loading

Merge Risk: ⚪ Minimal · up to 44b0f

No actionable issue remains in the inspected HyperCore USDC deposit flow or transaction migration. The PR is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: routing Hyperliquid USDC deposits through Relay.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added javascript Pull requests that update Javascript code M-synapse-interface Sol Typescript size/l labels Sep 23, 2026
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.08893%. Comparing base (ac66683) to head (44b0f25).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
packages/sdk-router/src/relay/relayModuleSet.ts 75.00000% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #4137         +/-   ##
===================================================
+ Coverage   57.57648%   58.08893%   +0.51245%     
===================================================
  Files            147         147                 
  Lines           4217        4228         +11     
  Branches         809         815          +6     
===================================================
+ Hits            2428        2456         +28     
+ Misses          1699        1674         -25     
- Partials          90          98          +8     
Flag Coverage Δ
packages 58.08893% <82.35294%> (+0.51245%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 44b0f25
Status: ✅  Deploy successful!
Preview URL: https://3d19cc04.sanguine-fe.pages.dev
Branch Preview URL: https://codex-hyperliquid-relay-depo.sanguine-fe.pages.dev

View logs

@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Bundle Report

Changes will decrease total bundle size by 14.11kB (-0.04%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sdk-router-@synapsecns/sdk-router-esm 486.45kB 1.09kB (0.22%) ⬆️
sdk-router-@synapsecns/sdk-router-cjs 220.5kB 383 bytes (0.17%) ⬆️
synapse-interface-server-cjs 2.28MB -7.84kB (-0.34%) ⬇️
synapse-interface-client-array-push 8.03MB -7.75kB (-0.1%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sdk-router-@synapsecns/sdk-router-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
sdk-router.cjs.production.min.js 383 bytes 220.5kB 0.17%

Files in sdk-router.cjs.production.min.js:

  • ./src/relay/relayModuleSet.ts → Total Size: 8.85kB

  • ./src/constants/addresses.ts → Total Size: 10.54kB

  • ./src/utils/TokenMetadataFetcher.ts → Total Size: 2.93kB

view changes for bundle: synapse-interface-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js 1.2kB 2.41MB 0.05%
static/css/*.css -298 bytes 157.28kB -0.19%
static/chunks/pages/index-*.js -77 bytes 66.76kB -0.12%
static/chunks/7789-*.js (New) 44.31kB 44.31kB 100.0% 🚀
static/chunks/4364-*.js -1 bytes 29.67kB -0.0%
static/chunks/pages/lifi-*.js -1 bytes 17.54kB -0.01%
static/chunks/7846-*.js -1 bytes 11.62kB -0.01%
static/chunks/8788-*.js -1 bytes 8.87kB -0.01%
static/QxTwivsxa8ZAZfPWjrmpU/_buildManifest.js (New) 6.67kB 6.67kB 100.0% 🚀
static/QxTwivsxa8ZAZfPWjrmpU/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/chunks/4089-*.js (Deleted) -52.88kB 0 bytes -100.0% 🗑️
static/Ehvt22Q1voYG3gyHh7WJx/_buildManifest.js (Deleted) -6.67kB 0 bytes -100.0% 🗑️
static/Ehvt22Q1voYG3gyHh7WJx/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

Files in static/chunks/pages/_app-*.js:

  • ./constants/index.ts → Total Size: 186 bytes

  • ./constants/bridgeMap.ts → Total Size: 86.85kB

  • ./constants/existingBridgeRoutes.ts → Total Size: 3.34kB

Files in static/css/*.css:

  • ./constants/existingBridgeRoutes.ts → Total Size: 3.34kB

  • ./constants/bridgeMap.ts → Total Size: 86.85kB

  • ./constants/index.ts → Total Size: 186 bytes

view changes for bundle: synapse-interface-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
6814.js 733 bytes 486.47kB 0.15%
../pages/index.js -65 bytes 77.18kB -0.08%
2007.js -8.93kB 50.77kB -14.95%
9192.js -1 bytes 9.07kB -0.01%
../pages/landing.js.nft.json 200 bytes 894 bytes 28.82% ⚠️
../pages/landing/sections/IntegrationSection.js.nft.json 224 bytes 499 bytes 81.45% ⚠️

Files in 6814.js:

  • ./constants/tokens/bridgeable.ts → Total Size: 40.55kB

  • ./utils/getPendingBridgeTransactionTrackingData.ts → Total Size: 1.11kB

  • ./store/migrations.ts → Total Size: 994 bytes

  • ./constants/existingBridgeRoutes.ts → Total Size: 3.2kB

  • ./constants/bridgeMap.ts → Total Size: 86.85kB

  • ./store/store.ts → Total Size: 3.96kB

  • ./store/reducer.ts → Total Size: 2.05kB

  • ./constants/index.ts → Total Size: 186 bytes

Files in ../pages/index.js:

  • ./components/_Transaction/_Transactions.tsx → Total Size: 2.99kB

Files in 2007.js:

  • ./components/StateManagedBridge/BridgeTransactionButton.tsx → Total Size: 7.04kB

  • ./components/StateManagedBridge/OutputContainer.tsx → Total Size: 6.9kB

  • ./pages/state-managed-bridge/index.tsx → Total Size: 22.65kB

  • ./components/StateManagedBridge/hooks/useBridgeValidations.ts → Total Size: 3.27kB

view changes for bundle: sdk-router-@synapsecns/sdk-router-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
sdk-router.esm.js 1.09kB 486.45kB 0.22%

Files in sdk-router.esm.js:

  • ./src/relay/relayModuleSet.ts → Total Size: 8.77kB

  • ./src/constants/addresses.ts → Total Size: 10.12kB

  • ./src/utils/TokenMetadataFetcher.ts → Total Size: 2.92kB

This branch had an error being deployed

1 failed deployment
Preview — 44b0f250 Deployed Sep 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant