Skip to content

Add Relay support tooling and off-curve workaround validation - #133

Draft
tracy-codes wants to merge 1 commit into
mainfrom
tracy/relay-support
Draft

Add Relay support tooling and off-curve workaround validation#133
tracy-codes wants to merge 1 commit into
mainfrom
tracy/relay-support

Conversation

@tracy-codes

@tracy-codes tracy-codes commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add reusable Relay-to-Swig adapter utilities for fetching quotes, resolving route instructions, rewriting account metas, and preparing getSignInstructions batches
  • add reproducible Surfpool scripts to validate Relay routes end-to-end, including a one-command runner that starts Surfpool, executes transactions, and prints custom-RPC Explorer links

Problem

Relay token routes currently fail quote construction when the Solana user is an off-curve address (for example a PDA wallet), returning NO_SWAP_ROUTES_FOUND. That prevents directly requesting token-route instructions for Swig wallet PDAs.

Current workaround in this PR

  • request quote data for an on-curve user
  • rewrite owner-coupled account metas (user + relevant source ATAs) to the Swig wallet context
  • execute via Swig CPI signing (getSignInstructions)

This preserves execution for supported routes while Relay off-curve user support is pending.

Validation

  • validated on Surfpool mainnet fork with USDC token flow and cheatcode-funded token accounts
  • baseline quote-user transaction and rewritten Swig-wrapped transaction both execute successfully and spend the expected token amount
  • added generic and focused repro scripts so this can be rerun/debugged quickly

Follow-up

Once Relay supports off-curve Solana users for token-route quoting, this rewrite workaround can be removed in favor of direct quote generation for the Swig wallet address.

Add reusable quote parsing and account rewrite helpers plus Surfpool validation scripts to test Relay routes with Swig signing. This documents and automates the current workaround for Relay token routes until off-curve user support is available.
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