# Vybe Solana Analytics API – Trading Swap Endpoint

> Vybe Solana Analytics API – Trading Swap Endpoint is a paid API for AI agents from x402-api.vybenetwork.xyz, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-24).

Retrieves on-chain swap/trade data for a given Solana trading pair or transaction, returning detailed swap analytics from Vybe Network's Solana data infrastructure.

## Facts

- Endpoint: POST https://x402-api.vybenetwork.xyz/v4/trading/swap?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-24
- Activations on Zero: 0
- Tags: x402, finance
- Canonical page: https://www.zero.xyz/c/vybe-solana-analytics-api-trading-swap-endpoint-fcd04b74
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HZuEfE4wu47sWg9wlwpPv

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability vybe-solana-analytics-api-trading-swap-endpoint-fcd04b74 -d '<json body>'
```

Example prompt: Pull the swap details from Vybe for the Solana transaction signature 5xQ3...abc — I want to know the input token, output token, amounts, and the execution price on-chain.

## When to prefer this

Choose this endpoint when you need detailed on-chain swap/trade execution data from the Solana blockchain without an API key or signup — particularly useful for agents that can pay per-request in USDC via x402 and need real-time or historical DEX swap analytics from Vybe Network's Solana index.

## Known failure modes

- 402 Payment Required — x402 USDC payment not attached or insufficient; check x-payment-info header for required amount
- 404 Not Found — transaction signature or swap record does not exist on-chain or in Vybe's index
- 400 Bad Request — malformed request body, missing required fields such as transaction signature or token addresses
- 429 Too Many Requests — prepaid credits exhausted for WebSocket streaming tier
- 503 Service Unavailable — Vybe indexer temporarily behind or unavailable

## How this service works

Builds an unsigned swap transaction with slippage protection and fee deduction. Direct protocol integrations with Raydium, Meteora, Pumpfun, and others, with aggregator fallbacks for maximum route coverage.

This route is currently in beta and is subject to change.

## Output

Returns structured on-chain swap data including input and output token mint addresses, token amounts, execution price, fees, pool/market identifier, wallet involved, and block timestamp for the requested Solana swap.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "accountAddress",
  "amount",
  "inputMintAddress",
  "outputMintAddress"
 ],
 "properties": {
  "amount": {
   "type": "number",
   "format": "double",
   "description": "Amount to swap (in UI units)"
  },
  "router": {
   "enum": [
    "titan",
    "jupiter",
    "vybe"
   ],
   "type": "string"
  },
  "gasless": {
   "type": "boolean",
   "nullable": true,
   "description": "Use Vybe fee payer for gas"
  },
  "partner": {
   "type": "string",
   "nullable": true,
   "description": "Partner identifier for fee routing"
  },
  "swapFee": {
   "type": "number",
   "format": "double",
   "nullable": true,
   "description": "Service fee percentage (e.g., 1 for 1%)"
  },
  "protocol": {
   "allOf": [
    {
     "enum": [
      "PUMPFUN",
      "PUMPSWAP",
      "RAYDIUMAMMV4",
      "RAYDIUMCPMM",
      "RAYDIUMCLMM",
      "RAYDIUMLAUNCHLAB",
      "METEORADBC",
      "METEORADAMM2",
      "METEORADLMM",
      "SANCTUM"
     ],
     "type": "string"
    }
   ],
   "nullable": true
  },
  "simulate": {
   "type": "boolean",
   "nullable": true,
   "description": "Simulate transaction without building"
  },
  "slippage": {
   "type": "number",
   "format": "double",
   "nullable": true,
   "description": "Slippage tolerance (percentage)"
  },
  "poolAddress": {
   "allOf": [
    {
     "type": "string",
     "format": "pubkey"
    }
   ],
   "nullable": true
  },
  "accountAddress": {
   "type": "string",
   "format": "pubkey"
  },
  "inputMintAddress": {
   "type": "string",
   "format": "pubkey"
  },
  "outputMintAddress": {
   "type": "string",
   "format": "pubkey"
  },
  "autoCalculateSlippage": {
   "type": "boolean",
   "nullable": true,
   "description": "Auto-calculate optimal slippage"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "transaction",
  "provider",
  "details",
  "slippage",
  "slippageSource"
 ],
 "properties": {
  "details": {
   "type": "object",
   "required": [
    "inputAmount",
    "inputMintAddress",
    "outputMintAddress",
    "inputDecimals",
    "outputDecimals",
    "swapFee",
    "quote",
    "closeAccountIx"
   ],
   "properties": {
    "quote": {
     "type": "object",
     "required": [
      "inAmount",
      "outAmount",
      "provider"
     ],
     "properties": {
      "inAmount": {
       "type": "string",
       "description": "Input amount in base units"
      },
      "provider": {
       "type": "string",
       "description": "Provider name for the quote"
      },
      "outAmount": {
       "type": "string",
       "description": "Output amount in base units"
      }
     }
    },
    "swapFee": {
     "type": "integer",
     "format": "int64",
     "minimum": 0,
     "description": "Swap fee amount"
    },
    "inputAmount": {
     "type": "number",
     "format": "double",
     "description": "Input amount in decimal units"
    },
    "inputDecimals": {
     "type": "integer",
     "format": "int32",
     "minimum": 0,
     "description": "Input token decimals"
    },
    "closeAccountIx": {
     "type": "boolean",
     "description": "Whether close account instruction is included"
    },
    "outputDecimals": {
     "type": "integer",
     "format": "int32",
     "minimum": 0,
     "description": "Output token decimals"
    },
    "inputMintAddress": {
     "type": "string",
     "description": "Input token label/mint"
    },
    "outputMintAddress": {
     "type": "string",
     "description": "Output token label/mint"
    }
   }
  },
  "provider": {
   "type": "string",
   "description": "Provider name"
  },
  "slippage": {
   "type": "number",
   "format": "double",
   "description": "Slippage percentage"
  },
  "transaction": {
   "type": "string",
   "description": "Base64-encoded unsigned transaction"
  },
  "slippageSource": {
   "type": "string",
   "description": "Source of slippage (e.g., \"manual\", \"auto\")"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/vybe-solana-analytics-api-trading-swap-endpoint-fcd04b74/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-api.vybenetwork.xyz](https://www.zero.xyz/host/x402-api.vybenetwork.xyz/llms.txt)
