Jupiter icon

Jupiter

Jupiter token swap operations

Overview

This node interacts with the Solana blockchain to perform token swaps using the Jupiter aggregator. It allows users to swap a specified amount of one token (input mint) for another token (output mint) on the Solana network, considering slippage tolerance. This is useful for decentralized finance (DeFi) applications where users want to exchange tokens efficiently and securely on Solana.

Use Case Examples

  1. Swapping SOL tokens for USDC tokens on Solana.
  2. Exchanging a specific amount of one SPL token for another with a maximum slippage limit.

Properties

Name Meaning
Input Mint The mint address of the token to swap from, specifying the source token for the swap.
Output Mint The mint address of the token to swap to, specifying the destination token for the swap.
Amount The amount of the input token to swap, expressed in lamports or the smallest unit of the token.
Slippage (Basis Points) The maximum slippage allowed for the swap, expressed in basis points (1% = 100), to control price impact during the swap.

Output

JSON

  • amountIn - The amount of input token used in the swap.
  • amountOut - The amount of output token received from the swap.
  • inputMint - The mint address of the input token.
  • outputMint - The mint address of the output token.
  • transactionSignature - The signature of the transaction on the Solana blockchain, confirming the swap.

Dependencies

  • Solana blockchain connection via @solana/web3.js
  • Jupiter aggregator functions for token swapping

Troubleshooting

  • Ensure the Solana API credentials (RPC URL, WebSocket endpoint, private key) are correctly configured and valid.
  • Verify that the input and output mint addresses are correct and correspond to valid tokens on Solana.
  • Check that the amount specified is available in the wallet associated with the private key.
  • Slippage tolerance should be set appropriately; too low may cause swap failures due to price changes.
  • Common errors may include transaction failures due to insufficient funds, invalid token mints, or network connectivity issues.

Links

Discussion