Skip to main content
SVM Gas Sponsorship is Dynamic’s built-in feature that automatically sponsors Solana (SVM) transaction fees for embedded wallet users.
SVM Gas Sponsorship is available exclusively for V3 MPC embedded wallets. It works automatically once enabled - no code changes required.

Overview

When enabled in your dashboard, the SDK automatically:
  1. Intercepts transactions before signing
  2. Sends them to Dynamic’s backend for sponsorship
  3. Returns a sponsored transaction with Dynamic as the fee payer
  4. User signs the sponsored transaction
  5. Transaction is broadcast to the network

Enabling SVM Gas Sponsorship

  1. Go to the Dynamic Dashboard
  2. Navigate to Settings > Embedded Wallets
  3. Ensure Solana (SOL) is enabled in your chain configurations
  4. Toggle on SVM Gas Sponsorship

Usage

Once enabled, transactions are automatically sponsored. No code changes needed:
import { signAndSendTransaction } from '@dynamic-labs-sdk/solana';

// Transaction is automatically sponsored if feature is enabled
const sendTransaction = async (walletAccount, transaction) => {
  const { signature } = await signAndSendTransaction({
    transaction,
    walletAccount
  });
  console.log('Transaction sent successfully.', signature);
};

Checking Sponsorship Status

import { getDynamicClient } from '@dynamic-labs-sdk/core';

const client = getDynamicClient();
const settings = client.getProjectSettings();
const sponsorshipEnabled = settings?.sdk?.embeddedWallets?.svmGasSponsorshipEnabled ?? false;

console.log('SVM Gas Sponsorship:', sponsorshipEnabled ? 'Enabled' : 'Disabled');

Limitations

LimitationDetails
Wallet typeEmbedded wallets only (V3 MPC)
Transaction sizeMaximum 2KB base64-encoded
Already-signedTransactions with signatures are not sponsored
BatchingEach transaction sponsored individually

Fallback Behavior

If sponsorship fails, the SDK falls back to the original transaction. Users will need SOL for gas fees in this case.

Error Handling

import { signAndSendTransaction } from '@dynamic-labs-sdk/solana';

const sendTransactionWithFallback = async (walletAccount, transaction) => {
  try {
    const { signature } = await signAndSendTransaction({
      transaction,
      walletAccount
    });
    return { success: true, signature };
  } catch (error) {
    const errorMessage = error.message?.toLowerCase() || '';

    if (errorMessage.includes('insufficient')) {
      return {
        success: false,
        error: 'Insufficient balance for transaction'
      };
    } else if (errorMessage.includes('sponsor')) {
      return {
        success: false,
        error: 'Gas sponsorship failed, SOL required for fees'
      };
    }

    return { success: false, error: error.message };
  }
};