Skip to main content

JupiterSwapTask

Fetch the simulated price for a swap on JupiterSwap.

Input: None

Returns: The swap price on Jupiter for a given input and output token mint address.

Example: Fetch the JupiterSwap price for exchanging 1 SOL into USDC.

{
"jupiterSwapTask": {
"inTokenAddress": "So11111111111111111111111111111111111111112",
"outTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}

Example: Fetch the JupiterSwap price for exchanging 1000 SOL into USDC.

{
"jupiterSwapTask": {
"inTokenAddress": "So11111111111111111111111111111111111111112",
"outTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"baseAmount": "1000"
}
}

See the JupiterSwapTask typescript definition in @switchboard-xyz/common

Fields

NameTypeDescription
 inTokenAddress

string

The input token address.

 outTokenAddress

string

The output token address.

 allowList

A list of AMM markets to allow.

 denyList

A list of AMM markets to deny.

 baseAmount

double

The amount of in_token_address tokens to swap.

 quoteAmount

double

The amount of out_token_address tokens to swap.

 baseAmountString

string

The amount of in_token_address tokens to swap.

 quoteAmountString

string

The amount of out_token_address tokens to swap.

 slippage

double

The allowable slippage on the swap in decimal form (e.g. 0.5 is 0.5% slippage)

Messages

 FilterList

NameTypeDescription
 labels

string

A list of Jupiter AMM labels to allow or deny (e.g. ‘Raydium’, ‘Orca’)