From 562c8e4d19e03eea2c6b5e1d5ae069ba6438f735 Mon Sep 17 00:00:00 2001 From: Waren Gonzaga Date: Tue, 3 Mar 2026 15:30:09 +0800 Subject: [PATCH 1/2] Add maxRouteLength guidance to Solana support docs Add a Transaction Size Optimization section explaining the 1232-byte Solana transaction size limit and how to use maxRouteLength to reduce swap routing hops. Includes recommended values (start at 4, try 3) and the includedOriginSwapSources fallback option. Co-Authored-By: Claude Opus 4.6 --- references/api/api_guides/solana.mdx | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/references/api/api_guides/solana.mdx b/references/api/api_guides/solana.mdx index afc8fe6..85a69c3 100644 --- a/references/api/api_guides/solana.mdx +++ b/references/api/api_guides/solana.mdx @@ -217,6 +217,47 @@ curl -X POST "https://api.relay.link/quote/v2" \ ``` +## Transaction Size Optimization + +Solana transactions have a hard **1232-byte** size limit. If you append custom +instructions to the transaction (e.g., for tracking, fee collection, or other +logic), the combined transaction can exceed this limit and fail. + +Pass **`maxRouteLength`** in your quote request to limit the number of hops in +the Solana swap routing. Fewer hops means a smaller transaction. + +**Recommended values:** + +| `maxRouteLength` | When to use | +| ---------------- | ----------- | +| `4` | Start here. Works for most integrations. | +| `3` | Use if transactions are still too large with `4`. | + + + As a last resort, you can also pass **`includedOriginSwapSources: ["jupiter"]`** in the + quote request. Jupiter tends to return smaller instructions, but this may limit + available routes. + + +```bash +curl -X POST "https://api.relay.link/quote/v2" \ + -H "Content-Type: application/json" \ + -d '{ + "user": "0x03508bb71268bba25ecacc8f620e01866650532c", + "originChainId": 8453, + "originCurrency": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + "destinationChainId": 792703809, + "destinationCurrency": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", + "recipient": "GTtzwxqy67xx9DVESJjx28TgXqpc8xTqtiytgNMaQBTE", + "tradeType": "EXACT_INPUT", + "amount": "10000000", + "maxRouteLength": 4 + }' +``` + +For the full list of quote parameters, see the +[Get Quote](/references/api/get-quote-v2) API reference. + ## SDK To use the SDK with Solana, install and configure the From 87281977848f79dd96838169859d920a69a86191 Mon Sep 17 00:00:00 2001 From: Waren Gonzaga Date: Tue, 3 Mar 2026 15:33:52 +0800 Subject: [PATCH 2/2] Update references/api/api_guides/solana.mdx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- references/api/api_guides/solana.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/references/api/api_guides/solana.mdx b/references/api/api_guides/solana.mdx index 85a69c3..0e0ab41 100644 --- a/references/api/api_guides/solana.mdx +++ b/references/api/api_guides/solana.mdx @@ -234,7 +234,7 @@ the Solana swap routing. Fewer hops means a smaller transaction. | `3` | Use if transactions are still too large with `4`. | - As a last resort, you can also pass **`includedOriginSwapSources: ["jupiter"]`** in the + As a last resort, you can also pass **`"includedOriginSwapSources": ["jupiter"]`** in the quote request. Jupiter tends to return smaller instructions, but this may limit available routes.