Introduction
SVM Gas Sponsorship is Dynamic’s built-in feature that automatically sponsors Solana (SVM) transaction fees for your users. When enabled, Dynamic handles all the complexity of fee sponsorship behind the scenes, allowing your users to transact without needing SOL for gas fees. When enabled, Dynamic automatically replaces the fee payer in Solana transactions with a sponsored account, so your users don’t need SOL for gas.SVM Gas Sponsorship is available exclusively for V3 MPC embedded wallets. It works automatically once enabled - no code changes required.
How It Differs From Manual Approaches
| Feature | SVM Gas Sponsorship | Manual Fee Payer |
|---|---|---|
| Setup | Toggle in dashboard | Server-side wallet management |
| Code changes | None required | API routes needed |
| Fee payer management | Handled by Dynamic | You manage the wallet |
| Best for | Embedded wallets | Custom implementations |
Getting Started
Prerequisites
Before enabling SVM Gas Sponsorship, ensure you have:- Solana enabled in your embedded wallet chain configurations
- V3 MPC wallets configured (Settings > Embedded Wallets > Wallet Version)
- A Live environment (sponsorship is available in both Sandbox and Live)
Enabling SVM Gas Sponsorship
- Go to the Dynamic Dashboard
- Navigate to Settings > Embedded Wallets
- Ensure Solana (SOL) is enabled in your chain configurations
- Toggle on SVM Gas Sponsorship
The SVM Gas Sponsorship toggle only appears when Solana is enabled in your chain configurations and you’re using V3 MPC wallets.
How It Works
Once enabled, gas sponsorship is applied automatically to all transactions from your users’ embedded wallets:Technical Flow
When your application calls transaction methods on an embedded Solana wallet:- Transaction Creation: Your app creates a standard Solana transaction
- Automatic Sponsorship: The SDK intercepts the transaction before signing
- Backend Processing: The transaction is sent to Dynamic’s backend
- Sponsorship Processing: Dynamic sponsors the transaction
- Fee Payer Replacement: The transaction’s fee payer is replaced with Dynamic’s sponsored account
- User Signing: The sponsored transaction is returned for the user to sign
- Broadcast: The fully signed transaction is sent to the Solana network
Supported Transaction Types
SVM Gas Sponsorship supports both Solana transaction formats:Versioned Transactions (Recommended)
Legacy Transactions
Legacy transactions are also supported, though versioned transactions are recommended for new implementations.Configuration
Environment-Level Settings
SVM Gas Sponsorship is configured per environment (Sandbox or Live). Each environment maintains its own sponsorship settings:- Sandbox: Use for development and testing
- Live: Use for production
Checking Sponsorship Status
You can programmatically check if gas sponsorship is enabled:Limitations
Wallet Requirements
- Embedded wallets only: Sponsorship only works with Dynamic’s MPC embedded wallets
- V3 wallets required: Must be using V3 MPC wallet configuration
- Not for external wallets: External wallets (Phantom, Solflare, etc.) are not supported
Transaction Constraints
- Transaction size: Maximum 2KB for the base64-encoded transaction
- Already-signed transactions: Transactions that are already signed will not be sponsored
- Single transaction: Each transaction is sponsored individually (no batching)
Sponsorship Policies
Dynamic may enforce sponsorship policies that could reject certain transactions. If a transaction cannot be sponsored, the SDK will fall back to using the original transaction, which requires the user to have SOL for gas fees.Security Considerations
Transaction Integrity
- Transactions are validated on Dynamic’s backend before sponsorship
- Base64 encoding is verified to prevent injection attacks
- Transactions are parsed and validated as legitimate Solana transactions
- The sponsored transaction only modifies the fee payer - your transaction logic remains unchanged
Authentication
All sponsorship requests require:- Valid JWT token from an authenticated SDK user
- Correct environment ID
- Active embedded wallet session
Rate Limiting
Sponsorship requests are subject to rate limiting based on your Dynamic plan. Monitor your usage in the dashboard to ensure adequate capacity for your application’s needs.Troubleshooting
Sponsorship Not Working
- Check wallet type: Verify you’re using a V3 MPC embedded wallet
- Check settings: Ensure SVM Gas Sponsorship is enabled in the dashboard
- Check Solana configuration: Confirm Solana is enabled in chain configurations
- Check authentication: Ensure the user is properly authenticated
Transaction Failures
If transactions fail after sponsorship:- Insufficient SOL for value transfer: Users still need SOL for the actual transfer amount (not fees)
- Invalid instructions: Ensure your transaction instructions are valid
- Network congestion: Retry during lower congestion periods
Fallback Behavior
When sponsorship fails, check the console for error messages. Common reasons include:- Feature not enabled for the environment
- Transaction already has signatures
- Transaction exceeds size limits
- Backend configuration issues
Best Practices
User Experience
- Don’t assume sponsorship: Build your UI to handle cases where sponsorship might not be available
- Show transaction status: Provide feedback during the sponsorship and signing process
- Handle errors gracefully: Inform users if they need SOL as a fallback
Development
- Test in Sandbox first: Verify sponsorship works in your Sandbox environment before going live
- Monitor usage: Keep an eye on sponsorship usage in your dashboard
- Use versioned transactions: They’re more efficient and recommended for new development
API Reference
Sponsor Transaction Endpoint
For advanced use cases, you can interact with the sponsorship API directly:Direct API usage is typically not needed - the SDK handles sponsorship automatically. Use this only for custom implementations.
Next Steps
- Learn about sending Solana transactions
- Explore Solana transaction tips for optimization
- Check out manual gasless transactions if you need a custom fee payer