> ## 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

> Swap USDC for Ondo Global Markets tokenized stocks

<a href="https://ondo.finance/global-markets" target="_blank">Ondo Global Markets</a> 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 <a href="https://jup.ag" target="_blank">Jupiter</a>, 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](/wallets/quickstarts/nodejs) 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 <a href="https://jup.ag/tokens/ondo" target="_blank">Jupiter Ondo screener</a>.

## 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.

<Note>
  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.
</Note>

<Tabs>
  <Tab title="React">
    ```typescript theme={null}
    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>
        );
    }
    ```
  </Tab>

  <Tab title="Node.js">
    ```typescript theme={null}
    import { CrossmintWallets, createCrossmint, SolanaWallet } from "@crossmint/wallets-sdk";
    import { VersionedTransaction } from "@solana/web3.js";

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

    const crossmint = createCrossmint({
        apiKey: "YOUR_SERVER_API_KEY",
    });

    const wallets = CrossmintWallets.from(crossmint);

    const wallet = await wallets.getWallet("email:USER_EMAIL:solana", {
        chain: "solana",
    });

    await wallet.useSigner({ type: "server", secret: "YOUR_SERVER_SIGNER_SECRET" });

    // 1. Get a quote from the Jupiter API
    const amountUsdc = "1000000"; // 1 USDC (6 decimals)
    const queryParams = new URLSearchParams({
        inputMint: USDC_MINT,
        outputMint: NVDA_ON_MINT,
        amount: amountUsdc,
        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);
    ```
  </Tab>

  <Tab title="REST">
    Transactions must be approved by one of the wallet's [signers](/wallets/concepts/signers).
    The SDK handles this automatically, but with the REST API you must [approve the transaction](/api-reference/wallets/approve-transaction) to complete it.

    <Steps>
      <Step title="Get a quote from Jupiter">
        Call the Jupiter quote endpoint with the USDC mint as input and the Ondo token mint as output.

        ```bash cURL theme={null}
        curl --request GET \
            "https://lite-api.jup.ag/swap/v1/quote?inputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&outputMint=gEGtLTPNQ7jcg25zTetkbmF7teoDLcrfTnQfmn2ondo&amount=1000000&slippageBps=300&maxAccounts=33"
        ```
      </Step>

      <Step title="Build the swap transaction">
        Pass the quote response to the Jupiter swap endpoint along with your wallet address.

        ```bash cURL theme={null}
        curl --request POST \
            --url "https://lite-api.jup.ag/swap/v1/swap" \
            --header "Content-Type: application/json" \
            --data '{"userPublicKey": "YOUR_WALLET_ADDRESS", "quoteResponse": YOUR_QUOTE_RESPONSE}'
        ```
      </Step>

      <Step title="Send the transaction">
        Follow the steps in the [Send a transaction](/wallets/guides/send-transaction-solana#rest) guide to submit the returned transaction.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={3}>
  <Card title="Jupiter Swap Guide" icon="arrow-right-arrow-left" href="/wallets/guides/wallet-extensions/swap-jupiter">
    Review the general Jupiter swap guide for additional configuration options.
  </Card>

  <Card title="Jupiter Ondo Screener" icon="magnifying-glass-chart" href="https://jup.ag/tokens/ondo">
    Explore all available Ondo tokens and their liquidity.
  </Card>

  <Card title="Ondo Global Markets" icon="building-columns" href="https://docs.ondo.finance/ondo-global-markets/overview">
    Learn about Ondo Global Markets tokenized assets.
  </Card>
</CardGroup>
