---
updatedAt: 2026-07-30T18:01:59.000Z
---

Fetch the complete documentation index at: https://docs.vybenetwork.com/llms.txt. Use this file to discover all available pages before exploring further.

# Gas Fee Sponsorship

Solana gasless awap API acts as fee payer so users can swap without holding SOL. Build and execute gasless Solana swaps across Pump.fun, Raydium and more.

Execute swaps without holding SOL for transaction fees. When gasless mode is enabled, Vybe sponsors the transaction fee on behalf of the user, removing one of the biggest friction points for new users and wallets that don't hold SOL.

## The Problem We Solve

New users often face this frustrating flow:

```
User has: 100 USDC from an airdrop
User wants: Swap to SOL
Problem: Can't swap without SOL for gas
Solution: Need to buy SOL first, but... how?
```

This creates a chicken-and-egg problem that kills conversion. Users who receive tokens from airdrops, transfers, or exchanges can't do anything without first acquiring SOL.

**Gasless mode eliminates this friction entirely.**

**Note:** Users still sign the transaction (Vybe never touches private keys). We simply pay the \~0.000005 SOL network fee so your users don't have to

***

## How It Works

```
Normal Swap:
┌─────────────────────────────────────────────────────┐
│ User Wallet                                         │
│   - Pays ~0.000005 SOL transaction fee              │
│   - Swaps tokens                                    │
└─────────────────────────────────────────────────────┘

Gasless Swap:
┌─────────────────────────────────────────────────────┐
│ User Wallet                                         │
│   - Signs transaction (proving ownership)           │
│   - Swaps tokens                                    │
│                                                     │
│ Vybe Fee Payer                                      │
│   - Pays the ~0.000005 SOL transaction fee          │
└─────────────────────────────────────────────────────┘
```

The transaction is identical—same instructions, same swap—just with Vybe as the fee payer instead of the user.

***

## Demo for Solana Swap API & Router

The free live demo for these endpoints can be found here:

* Live demo: <Anchor target="_blank" href="https://solana-swap-api.vybenetwork.com"><https://solana-swap-api.vybenetwork.com></Anchor>
* GitHub repo: <Anchor target="_blank" href="https://github.com/vybenetwork/solana-swap-api"><https://github.com/vybenetwork/solana-swap-api></Anchor>

![](https://files.readme.io/6e2aba155ff1474307d625911463b9364524740068060ee9ec138f8309906a6f-image.png)

You can visit this link to access and try the demo: <Anchor target="_blank" href="https://solana-swap-api.vybenetwork.com"><https://solana-swap-api.vybenetwork.com></Anchor>

***

## Enable Gasless Mode

Add `gasless: true` to your swap request:

```bash
curl -X POST "https://api.vybenetwork.com/trading/swap" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "wallet": "UserWalletAddress",
    "amount": 100,
    "inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "outputMint": "So11111111111111111111111111111111111111112",
    "router": "vybe",
    "slippage": 1,
    "gasless": true
  }'
```

That's it. The returned transaction will have Vybe as the fee payer.

***

## Use Cases

### 1. Onboarding New Users

New users from airdrops or transfers can swap immediately:

```javascript
async function onboardingSwap(userWallet, tokenMint, amount) {
  // User has tokens but no SOL
  const response = await fetch('https://api.vybenetwork.com/trading/swap', {
    method: 'POST',
    headers: {
      'X-API-Key': API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      wallet: userWallet,
      amount,
      inputMint: tokenMint,
      outputMint: 'So11111111111111111111111111111111111111112', // SOL
      gasless: true,  // Vybe pays gas
      slippage: 2
    })
  });
  
  return response.json();
}
```

### 2. Token-Only Wallets

Wallets funded only with tokens (from CEX withdrawal, bridge, etc.):

```javascript
async function swapFromTokenOnlyWallet(wallet, inputToken, outputToken, amount) {
  // Check if user has SOL
  const solBalance = await connection.getBalance(new PublicKey(wallet));
  const needsGasless = solBalance < 5000; // Less than 0.000005 SOL
  
  return fetch('https://api.vybenetwork.com/trading/swap', {
    method: 'POST',
    headers: { 'X-API-Key': API_KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({
      wallet,
      amount,
      inputMint: inputToken,
      outputMint: outputToken,
      gasless: needsGasless,
      slippage: 2
    })
  }).then(r => r.json());
}
```

### 3. Smoother UX for All Users

Remove the "insufficient SOL for gas" error from your app entirely:

```javascript
async function smartSwap(params) {
  try {
    // Try normal swap first
    return await executeSwap({ ...params, gasless: false });
  } catch (error) {
    // If insufficient SOL, retry with gasless
    if (error.message.includes('insufficient') && error.message.includes('SOL')) {
      return await executeSwap({ ...params, gasless: true });
    }
    throw error;
  }
}
```

***

## Complete Gasless Flow

```javascript
import { Connection, Transaction } from '@solana/web3.js';

async function executeGaslessSwap(wallet, inputMint, outputMint, amount) {
  // 1. Build gasless transaction
  const response = await fetch('https://api.vybenetwork.com/trading/swap', {
    method: 'POST',
    headers: {
      'X-API-Key': API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      wallet: wallet.publicKey.toString(),
      amount,
      inputMint,
      outputMint,
      gasless: true,
      slippage: 2
    })
  });
  
  const { transaction: txBase64 } = await response.json();
  
  // 2. Deserialize
  const transaction = Transaction.from(Buffer.from(txBase64, 'base64'));
  
  // 3. User signs (partial signature - user only)
  transaction.partialSign(wallet);
  
  // 4. Submit to network
  // The transaction already has Vybe's signature for fee payment
  const connection = new Connection('https://api.mainnet-beta.solana.com');
  const signature = await connection.sendRawTransaction(transaction.serialize());
  
  // 5. Confirm
  await connection.confirmTransaction(signature, 'confirmed');
  
  return signature;
}
```

***

## Security Model

Gasless mode is secure by design:

| Aspect                    | How It Works                                     |
| ------------------------- | ------------------------------------------------ |
| **User sovereignty**      | User still signs the transaction                 |
| **Key security**          | Vybe never sees private keys                     |
| **Transaction integrity** | Same swap instructions, just different fee payer |
| **No custody**            | Tokens go directly user → DEX → user             |

The only difference is who pays the \~0.000005 SOL network fee.

***

## Availability & Limits

| Aspect                | Details                         |
| --------------------- | ------------------------------- |
| **Plans**             | Pro and Enterprise plans        |
| **Transaction types** | Swaps only                      |
| **Rate limits**       | Same as your plan tier          |
| **Fee cost**          | Vybe absorbs the \~0.000005 SOL |

***

## Implementation Patterns

### Always Gasless

For maximum user friendliness:

```javascript
const ALWAYS_GASLESS = true;

async function swap(params) {
  return executeSwap({ ...params, gasless: ALWAYS_GASLESS });
}
```

### Smart Gasless (Check Balance First)

For cost optimization:

```javascript
async function smartGaslessSwap(wallet, params) {
  const balance = await connection.getBalance(wallet);
  const needsGasless = balance < 10000; // ~0.00001 SOL threshold
  
  return executeSwap({ ...params, gasless: needsGasless });
}
```

### User Choice

Let users decide:

```javascript
function SwapForm({ onSwap }) {
  const [gasless, setGasless] = useState(false);
  const { balance } = useWalletBalance();
  
  const insufficientSol = balance < 10000;
  
  return (
    <form>
      {/* ... other fields ... */}
      
      <label>
        <input 
          type="checkbox" 
          checked={gasless || insufficientSol}
          onChange={(e) => setGasless(e.target.checked)}
          disabled={insufficientSol}
        />
        Gasless mode (Vybe pays gas)
        {insufficientSol && <span> - Required (low SOL balance)</span>}
      </label>
      
      <button onClick={() => onSwap({ gasless })}>
        Swap
      </button>
    </form>
  );
}
```

***

## Next Steps

* [Build Transaction](./build-transaction) - Add gasless to your swaps
* [Pricing](./pricing) - Plans with gasless access
* [Quick Start](./quick-start) - Get started with the API

<br />