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" } }

Implements

Constructors

Properties

allowList?: IFilterList

A list of AMM markets to allow.

baseAmount?: number

The amount of in_token_address tokens to swap.

baseAmountString?: string

The amount of in_token_address tokens to swap.

denyList?: IFilterList

A list of AMM markets to deny.

inTokenAddress: string

The input token address.

outTokenAddress: string

The output token address.

quoteAmount?: number

The amount of out_token_address tokens to swap.

quoteAmountString?: string

The amount of out_token_address tokens to swap.

RoutesFilters?: "allowList" | "denyList"

JupiterSwapTask RoutesFilters.

slippage: number

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

SwapAmount?:
    | "baseAmount"
    | "quoteAmount"
    | "baseAmountString"
    | "quoteAmountString"

JupiterSwapTask SwapAmount.

JupiterSwapTask version.

Methods

  • Converts this JupiterSwapTask to JSON.

    Returns { [k: string]: any }

    JSON object

  • Creates a new JupiterSwapTask instance using the specified properties.

    Parameters

    Returns OracleJob.JupiterSwapTask

    JupiterSwapTask instance

  • Decodes a JupiterSwapTask message from the specified reader or buffer.

    Parameters

    • reader: Uint8Array<ArrayBufferLike> | Reader

      Reader or buffer to decode from

    • Optionallength: number

      Message length if known beforehand

    Returns OracleJob.JupiterSwapTask

    JupiterSwapTask

    If the payload is not a reader or valid buffer

    If required fields are missing

  • Decodes a JupiterSwapTask message from the specified reader or buffer, length delimited.

    Parameters

    • reader: Uint8Array<ArrayBufferLike> | Reader

      Reader or buffer to decode from

    Returns OracleJob.JupiterSwapTask

    JupiterSwapTask

    If the payload is not a reader or valid buffer

    If required fields are missing

  • Encodes the specified JupiterSwapTask message. Does not implicitly verify messages.

    Parameters

    • message: IJupiterSwapTask

      JupiterSwapTask message or plain object to encode

    • Optionalwriter: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Encodes the specified JupiterSwapTask message, length delimited. Does not implicitly verify messages.

    Parameters

    • message: IJupiterSwapTask

      JupiterSwapTask message or plain object to encode

    • Optionalwriter: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Creates a JupiterSwapTask message from a plain object. Also converts values to their respective internal types.

    Parameters

    • object: { [k: string]: any }

      Plain object

    Returns OracleJob.JupiterSwapTask

    JupiterSwapTask

  • Gets the default type url for JupiterSwapTask

    Parameters

    Returns string

    The default type url

  • Creates a plain object from a JupiterSwapTask message. Also converts values to other types if specified.

    Parameters

    Returns { [k: string]: any }

    Plain object

  • Verifies a JupiterSwapTask message.

    Parameters

    • message: { [k: string]: any }

      Plain object to verify

    Returns string

    null if valid, otherwise the reason why it is not