Skip to main content
Ultra Swap API is no longer actively maintained and has been superseded by Swap V2.
The payer parameter lets integrators cover all network fees and rent for their users, removing the gasless requirements (no minimum trade size, no SOL balance check). It must be used with referralAccount and referralFee, and enforces Metis-only routing. The integrator backend must co-sign the transaction before submitting to /execute.
If you are unfamiliar with Ultra Swap’s Gasless Support mechanisms, please refer to the doc.

Key Points

The Jupiter Ultra Swap API allows you to pay for networks fees and rent on behalf of your users. This feature further reduces onboarding friction as the integrator can now ensure gasless is enforced without requiring any additional requirements in Ultra’s Gasless Support like taker has to have < 0.01 SOL, minimum trade size or having to use the user’s swap amount.

Payer

To use the payer parameter, you need to pass in the following parameters:
  • payer: The public key of the account that will be used to pay for the network fees, priority fees/tips and rents.
  • closeAuthority: Optional. Defaults to taker if not used. The public key of the account that will be the close authority of the token accounts created during the swap (apart from WSOL token account). It only applies to taker’s token accounts and not the receiver’s if any.
However, as mentioned above, to use payer, it is expected to be used with referral parameters such as referralAccount and referralFee because it is assumed that the integrator will need to recoup the costs using referral fees.
  • referralAccount: The public key of the referral account that is collecting the fees.
  • referralFee: The fee bps that will be collected from the swap.
  • Refer to Add Fees to Ultra Swap guide for more details on how to set up.
Get Order

Close Authority

When using payer parameter, you may optionally use closeAuthority parameter, but only use when necessary/intentional and is typically set to payer to gain the close authority. When token accounts are created for the output swap amount, the rent of the token accounts are essentially being given away, in order to prevent a loss or abuse of the integrator gas payer, there are a few ways to handle it.
  1. You can charge sufficient fees to ensure that it can cover the amount used by the payer.
  2. You can set yourself as the close authority of the token account such that you have the authority to close the account and be the recipient of the rent.
If the taker’s token account never reaches zero amount, it means that you are unable to close the token account, causing your SOL to be “stuck”.
Usage of closeAuthority parameter:
  • If closeAuthority is not provided, we will default to taker.
  • If closeAuthority is provided and is different from taker, we will add the instruction to set the new closeAuthority.
Refer to Solana Docs for more details on the close authority.