Migrating the API or SDK
Migrating the API
From v3 to v4
- You do not have to support Versioned Transactions to migrate to v4. You can set the
parameterasLegacyTransaction=trueto have the api return a legacy swap transaction. - V3 used Legacy transactions. V4 has migrated to use Versioned Transactions with Address Lookup Tables.
- With
VersionedTransactionand Address Lookup Tables, all Jupiter swaps are done in a single transaction so no longer a need to handle sequentially sending more than one transaction. - Use
VersionedTransaction.deserializeto deserialize the transaction object in order to insert your own instructions in the transaction. - V4 swagger: https://quote-api.jup.ag/v4/docs/static/index.html
From v1 to v3
- Remove token ledger
- Change
slippagetoslippageBps - Route now return
slippageBps - V1 swagger : https://quote-api.jup.ag/docs/static/index.html
- V3 swagger: https://quote-api.jup.ag/v3/docs/static/index.html
Migrating the SDK
From v2 to v3
slippageBpsinstead ofslippageslippageBps= Math.ceil(slippage*100)
- Remove the need of token ledger
- Example: https://github.com/jup-ag/jupiter-core-example/commit/1f6967e46736b52ba9b4d7a85f91d2628e3d0e26
From v1 to v2
jupiter.computeRoutes,inputAmountchanged toamountand the typing is changed from number to JSBI. (https://github.com/GoogleChromeLabs/jsbi)- The result of
computeRoutesalso return JSBI likeinAmountandoutAmount.
- The result of
outAmountWithSlippagechanged tootherAmountThreshold- Example: https://github.com/jup-ag/jupiter-nextjs-example/commit/ff91a085f129d34cf83b14b1fda62ef370d7f1a9