You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/100-swap-api/1-get-quote.md
+38-7Lines changed: 38 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,22 +140,57 @@ Please be aware that using `onlyDirectRoutes` can often yield unfavorable trades
140
140
141
141
In some cases, you may want to add more accounts to the transaction for specific use cases, but it might exceed the transaction size limit. You can use the `maxAccounts` parameter to limit the number of accounts in the transaction.
142
142
143
+
:::warning unfavorable trades
144
+
Please be aware that the misuse of `maxAccounts` can yield unfavorable trades or outcomes.
145
+
:::
146
+
143
147
:::tip
144
148
- Refer to the [Requote with Lower Max Accounts](/docs/swap-api/requote-with-lower-max-accounts) guide for more information on how to requote and adjust the swap when using `maxAccounts`.
145
149
:::
146
150
147
151
:::note
148
-
-`maxAccounts` is only an estimation and the actual number of accounts may vary.
152
+
-`maxAccounts` is an estimation and the actual number of accounts may vary.
153
+
-`maxAccounts` only applies to the total number of accounts of the inner swaps in the swap instruction and not any of the setup, cleanup or other instructions (see the example below).
149
154
- We recommend setting `maxAccounts` to 64
150
155
- Keep `maxAccounts` as large as possible, only reduce `maxAccounts` if you exceed the transaction size limit.
151
-
- If `maxAccounts` is set too low, example to 30, the computed routes may drop DEXes/AMMs like Meteora DLMM that require more than 30 accounts.
156
+
- If `maxAccounts` is set too low, example to 30, the computed route may drop DEXes/AMMs like Meteora DLMM that require more than 30 accounts.
152
157
153
158
<br/>
154
-
**Jupiter has 2 types of routing instructions** and if you plan to limit `maxAccounts`, you will need to account for if the market is routable with [ALTs](https://docs.solana.com/developing/lookup-tables) or not:
159
+
**Jupiter has 2 types of routing instructions**, if you plan to limit `maxAccounts`, you will need to account for if the market is routable with [ALTs](https://docs.solana.com/developing/lookup-tables) or not:
155
160
-**`Routing Instruction`** (Simple Routing): The market is still new, and we do not have ALTs set up for the market, hence the number of accounts required is higher as there are more accounts required.
156
161
-**`Shared Accounts Routing Instruction`**: The market has sufficient liquidity (and has been live for a while), and we have [ALTs](https://docs.solana.com/developing/lookup-tables) set up for the market to be used in the routing instruction, hence the number of accounts required is lower as there are less accounts required.
157
162
:::
158
163
164
+
<details>
165
+
<summary>
166
+
<div>
167
+
<div>
168
+
<b>Counting the accounts using an example transaction</b>
169
+
</div>
170
+
</div>
171
+
</summary>
172
+
173
+
[In this transaction](https://solscan.io/tx/2xpiniSn5z61hE6gB6EUaeRZCqeg8rLBEbiSnAjSD28tjVTSpBogSLfrMRaJiDzuqDyZ8v49Z7WL2TKvGQVwYbB7):
0 commit comments