add maxAccounts=50 to Jupiter swaps to limit txn size
This commit is contained in:
parent
1c4de6fac9
commit
4cd0a70d0b
|
@ -151,6 +151,7 @@ export const fetchJupiterTransaction = async (
|
|||
// This is the ATA account for the output token where the fee will be sent to. If you are swapping from SOL->USDC then this would be the USDC ATA you want to collect the fee.
|
||||
// feeAccount: 'fee_account_public_key',
|
||||
slippageBps: Math.ceil(slippage * 100),
|
||||
maxAccounts: 50
|
||||
}),
|
||||
})
|
||||
).json()
|
||||
|
|
|
@ -30,6 +30,7 @@ const fetchJupiterRoute = async (
|
|||
swapMode = 'ExactIn',
|
||||
feeBps = 0,
|
||||
onlyDirectRoutes = true,
|
||||
maxAccounts = 50
|
||||
) => {
|
||||
{
|
||||
const paramsString = new URLSearchParams({
|
||||
|
@ -38,6 +39,7 @@ const fetchJupiterRoute = async (
|
|||
amount: amount.toString(),
|
||||
slippageBps: Math.ceil(slippage * 100).toString(),
|
||||
pfeeBps: feeBps.toString(),
|
||||
maxAccounts: maxAccounts.toString(),
|
||||
swapMode,
|
||||
onlyDirectRoutes: `${onlyDirectRoutes}`,
|
||||
}).toString()
|
||||
|
|
Loading…
Reference in New Issue