Skip to main content
Token swaps on Solana via Jupiter — the leading DEX aggregator. Jupiter routes your swap across multiple liquidity sources to find the best price.

Functions

glosso_quote(inputMint, outputMint, amount)

Get a swap quote without executing. Script: tsx scripts/quote.ts <inputMint> <outputMint> <amount>
ParameterTypeDescription
inputMintstringToken mint address you’re selling
outputMintstringToken mint address you’re buying
amountnumberAmount of inputMint in base units (lamports / smallest denomination)
Returns:
{
  "inputMint": "So11111111111111111111111111111111111111112",
  "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "inAmount": "1000000000",
  "outAmount": "142350000",
  "priceImpactPct": "0.01",
  "routePlan": [
    { "swapInfo": { "ammKey": "...", "label": "Raydium" } }
  ]
}

glosso_swap(inputMint, outputMint, amount, slippageBps?)

Execute a swap. Script: tsx scripts/swap.ts <inputMint> <outputMint> <amount> [--slippage 50]
ParameterTypeDefaultDescription
inputMintstringToken mint you’re selling
outputMintstringToken mint you’re buying
amountnumberInput amount in base units
slippageBpsnumber50Slippage tolerance in basis points (50 = 0.5%)
Returns:
{
  "signature": "5xKp...",
  "inputMint": "So111...",
  "outputMint": "EPjFW...",
  "inAmount": "1000000000",
  "outAmount": "142290000",
  "explorer": "https://explorer.solana.com/tx/5xKp...?cluster=mainnet-beta"
}

Common Mint Addresses

TokenMint
SOL (wrapped)So11111111111111111111111111111111111111112
USDCEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
USDTEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
JUPJUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN
BONKDezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
glosso-jupiter is designed for mainnet. On devnet, liquidity pools may not exist or have extreme price impact. Test with small amounts.