Skip to content

feat: Enable Across support for perps deposits#8334

Open
pedronfigueiredo wants to merge 2 commits intomainfrom
pnf/allow-usdcperps-deposit
Open

feat: Enable Across support for perps deposits#8334
pedronfigueiredo wants to merge 2 commits intomainfrom
pnf/allow-usdcperps-deposit

Conversation

@pedronfigueiredo
Copy link
Copy Markdown
Contributor

@pedronfigueiredo pedronfigueiredo commented Mar 30, 2026

Explanation

Re-enable Across for perps deposits by allowing the specific quote-time perpsDeposit route and normalizing Arbitrum USDC targets to Across’s new HyperCore USDC-PERPS direct-deposit token. Keep the change limited so only the supported perps deposit flow bypasses Across’s same-chain rejection and same-token quote skipping.

At quote-build time, transaction pay still represents the required asset as Arbitrum USDC, so Across sees sourceChainId === targetChainId and “same token” even though the real destination we need to quote is HyperCore 1337 + 0x2100...0000. If we do not bypass those checks for this narrow case, the request is filtered out before we ever rewrite it into the actual Across direct-deposit route.

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

Medium Risk
Changes Across strategy request filtering and quote-shaping for perpsDeposit, including token/chain rewriting and bypassing same-token/same-chain skips; mistakes could misroute deposits or produce incorrect quote amounts.

Overview
Re-enables Across for a narrow perpsDeposit path by allowing same-chain Arbitrum USDC requests when they match a supported perps-direct-deposit shape, instead of rejecting them as same-chain swaps.

Adds a perps-specific normalization layer that rewrites quote requests to Across’s HyperCore direct-deposit route (chain/token + USDC 6→8 decimal amount conversion) and adjusts destination handling to produce no post-swap actions and use from as recipient. Also updates source-amount calculation to avoid skipping “same token” quotes for this perps+Across case, with expanded test coverage and changelog entry.

Written by Cursor Bugbot for commit efc279b. This will update automatically on new commits. Configure here.

@pedronfigueiredo pedronfigueiredo self-assigned this Mar 30, 2026
@pedronfigueiredo pedronfigueiredo requested a review from a team as a code owner March 30, 2026 13:31
@pedronfigueiredo pedronfigueiredo requested a review from a team as a code owner March 30, 2026 13:31
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/allow-usdcperps-deposit branch from 1261941 to 677ae2e Compare March 30, 2026 13:33
@pedronfigueiredo pedronfigueiredo changed the title feat: Reenable limited Across support for perps deposits feat: Enable Across support for perps deposits Mar 30, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.


- Add route-based `confirmations_pay` strategy resolution ([#8282](https://github.com/MetaMask/core/pull/8282))

### Fixed
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.

Wouldn't it be more suitable as an Added ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants