Skip to content

Commit bb196ab

Browse files
Make dynamic compute limit configurable
1 parent 343f003 commit bb196ab

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/jupiter_python_sdk/jupiter.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,8 @@ async def swap(
649649
as_legacy_transaction: bool=False,
650650
exclude_dexes: list=None,
651651
max_accounts: int=None,
652-
platform_fee_bps: int=None
652+
platform_fee_bps: int=None,
653+
dynamic_compute_limit: bool=False
653654
) -> str:
654655
"""Perform a swap.
655656
@@ -667,7 +668,8 @@ async def swap(
667668
``as_legacy_transaction (bool)``: Default is False. Instead of using versioned transaction, this will use the legacy transaction.\n
668669
``exclude_dexes (list)``: Default is that all DEXes are included. You can pass in the DEXes that you want to exclude in a list. For example, ['Aldrin','Saber'].\n
669670
``max_accounts (int)``: Find a route given a maximum number of accounts involved, this might dangerously limit routing ending up giving a bad price. The max is an estimation and not the exact count.\n
670-
``platform_fee_bps (int)``: If you want to charge the user a fee, you can specify the fee in BPS. Fee % is taken out of the output token.
671+
``platform_fee_bps (int)``: If you want to charge the user a fee, you can specify the fee in BPS. Fee % is taken out of the output token.\n
672+
``dynamic_compute_limit (bool)``: Enable dynamic compute limit for the transaction. Default is False.
671673
672674
Returns:
673675
``str``: returns serialized transactions to perform the swap from https://quote-api.jup.ag/v6/swap
@@ -701,7 +703,8 @@ async def swap(
701703
transaction_parameters = {
702704
"quoteResponse": quoteResponse,
703705
"userPublicKey": self.keypair.pubkey().__str__(),
704-
"wrapAndUnwrapSol": wrap_unwrap_sol
706+
"wrapAndUnwrapSol": wrap_unwrap_sol,
707+
"dynamicComputeUnitLimit": dynamic_compute_limit
705708
}
706709
if prioritization_fee_lamports:
707710
transaction_parameters.update({"prioritizationFeeLamports": prioritization_fee_lamports})

0 commit comments

Comments
 (0)