# Check risk before a Solana swap

Send a token mint, side and amount to inspect route impact, historical sandwich exposure and token controls before a swap, without signing or executing it.

## Describe the proposed swap

For “What risks are visible before buying or selling this token?”, use `swap_preflight`. Pass the token `mint`, `side` (`buy` or `sell`), a positive `amount`, and optional `quote` mint (wrapped SOL by default). These are mint addresses, not a pool or Position account.

For a buy, amount is in human quote-token units; for a sell, it is in human units of the token being sold. The catalog example below buys with 100 units of its specified USDC quote. It is a request example, not a recommended trade or a recorded verdict.

## Read assessment, reasons and coverage

The check examines route price impact, sandwich exposure from observed pool history, Token-2022 transfer fees/hooks and permanent delegate, mint authority and freeze authority. The assessment can be `ok`, `unverified`, `high_slippage_risk`, `high_sandwich_risk` or `blocked`. Read it alongside the verdict, reasons, warnings, history coverage and `generated_at`.

Missing swap history means exposure was not measured; it does not mean the route is safe. Market state and route availability can change after the observation. The request does not sign, submit, simulate an arbitrary transaction or reserve an execution price. It does not provide MEV protection or a guarantee against loss.

For pool-specific liquidity and historical LP returns, use the [pool guide](https://dexra.dev/guides/solana-pool-risk). For current principal and fees in an actual Orca position, use the [position guide](https://dexra.dev/guides/orca-lp-position).

## Account, cost and connection

Register at [dexra.dev/signup](https://dexra.dev/signup), confirm your email and create an API key in the account. Send `Authorization: Bearer $DEXRA_API_KEY` or `X-Api-Key` for analytical calls. The zero-credit `describe_address` still requires an account. Only `service_stats` and `score_performance` are anonymous public reports.

Pool, range, position and swap checks use account credits. Each task guide shows current per-call prices and requests from the public catalog; [credits and x402 payments](https://dexra.dev/docs/paying) and [account limits](https://dexra.dev/docs/limits) apply. x402 pay-per-call also requires an account key. Reading this guide does not run an analysis.

```sh
claude mcp add --transport http dexra https://api.dexra.dev/mcp \
  --header "Authorization: Bearer $DEXRA_API_KEY"
```

Set `DEXRA_API_KEY` locally; keep the value out of shared prompts and files. Connect through a client that supports Streamable HTTP, then use its normal `initialize`, `tools/list` and `tools/call` flow. The request bodies below are tool-call examples, not a separate protocol. See [MCP setup](https://dexra.dev/docs/mcp) and [REST setup](https://dexra.dev/docs/rest).

## Requests and current cost

Examples use the current public catalog. Replace example addresses and amounts with the user’s intended inputs. Calling these endpoints consumes the tool’s normal account credits; no call runs from this page.

### [`swap_preflight`](https://dexra.dev/docs/tools/swap_preflight)

1 credits · 0.005 USDC per call. See the reference for the full input schema.

```sh
curl 'https://api.dexra.dev/swap_preflight?amount=100&mint=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263&quote=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&side=buy' \
  --header "Authorization: Bearer $DEXRA_API_KEY"
```

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "swap_preflight",
    "arguments": {
      "amount": 100,
      "mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
      "quote": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "side": "buy"
    }
  }
}
```

## Use the source contracts

[Tool reference](https://dexra.dev/docs/tools) · [Public MCP card](https://api.dexra.dev/.well-known/mcp.json) · [OpenAPI](https://api.dexra.dev/openapi.json) · [Responses and errors](https://dexra.dev/docs/responses)

For a reusable task-routing workflow, see the [agent skill source](https://github.com/dexra-dev/mcp/tree/13c3da1e29f18cabdea74cba286b7753608f2760/skills/dexra-solana-risk). A skill supplies instructions; it does not configure MCP, create an account or grant permission to spend credits.

[Read this page as Markdown](https://dexra.dev/guides/solana-swap-preflight.md). Automated observations inform the user’s decision; they are not financial advice.

Source: https://dexra.dev/guides/solana-swap-preflight
