Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt

Use this file to discover all available pages before exploring further.

Ondo Global Markets offers tokenized versions of publicly-traded stocks and ETFs on Solana. These tokens (such as NVDAon for Nvidia, TSLAon for Tesla, and SPYon for S&P 500) can be swapped on decentralized exchanges via Jupiter, making them accessible to both human users and AI agents through Crossmint wallets. This guide demonstrates how to swap USDC for Ondo GM tokens using the Jupiter swap API with Crossmint wallets on Solana.

Prerequisites

  • A Crossmint wallet on Solana with USDC balance. See the wallets quickstart to create one.
  • API Key: A server-side API key (sk_...) with the scope wallets:transactions.create.
  • The Solana mint address for your target Ondo token. Find all available Ondo tokens and their liquidity on the Jupiter Ondo screener.

Swap USDC for Ondo Tokens

The swap flow uses the same pattern as any Jupiter swap with Crossmint wallets:
  1. Request a quote from the Jupiter API for the USDC to Ondo token pair.
  2. Build the swap transaction using the Jupiter API.
  3. Sign and send the transaction using the Crossmint wallet.
Ondo GM tokens on Jupiter may route through multiple AMM pools (such as Manifest, Meteora DLMM, or Raydium CLMM). Always set maxAccounts=33 to ensure multi-hop swaps fit within Solana transaction account limits.
import { useWallet, SolanaWallet } from "@crossmint/client-sdk-react-ui";
import { VersionedTransaction } from "@solana/web3.js";

const USDC_MINT = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
const NVDA_ON_MINT = "gEGtLTPNQ7jcg25zTetkbmF7teoDLcrfTnQfmn2ondo";

export function SwapToOndoComponent() {
    const { wallet } = useWallet();

    async function swapUsdcToOndo(ondoMint: string, amountUsdc: number) {
        if (!wallet) {
            return;
        }

        // 1. Get a quote from the Jupiter API
        const queryParams = new URLSearchParams({
            inputMint: USDC_MINT,
            outputMint: ondoMint,
            amount: amountUsdc.toString(),
            slippageBps: "300",
            maxAccounts: "33",
        });

        const quoteResponse = await fetch(
            `https://lite-api.jup.ag/swap/v1/quote?${queryParams}`
        );
        const quoteData = await quoteResponse.json();

        // 2. Build the swap transaction
        const swapResponse = await fetch("https://lite-api.jup.ag/swap/v1/swap", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({
                userPublicKey: wallet.address,
                quoteResponse: quoteData,
            }),
        });
        const swapData = await swapResponse.json();

        // 3. Sign and send the transaction
        const solanaWallet = SolanaWallet.from(wallet);
        const versionedTransaction = VersionedTransaction.deserialize(
            Buffer.from(swapData.swapTransaction, "base64")
        );

        const tx = await solanaWallet.sendTransaction({
            transaction: versionedTransaction,
        });

        console.log("Swap complete:", tx.hash);
    }

    return (
        <button onClick={() => swapUsdcToOndo(NVDA_ON_MINT, 1000000)}>
            Swap 1 USDC for NVDAon
        </button>
    );
}

Next Steps

Jupiter Swap Guide

Review the general Jupiter swap guide for additional configuration options.

Jupiter Ondo Screener

Explore all available Ondo tokens and their liquidity.

Ondo Global Markets

Learn about Ondo Global Markets tokenized assets.