swap_preflight
1 credit · 0.005 USDCGET /swap_preflight
Before a Solana swap: price impact on the best route, sandwich share on the pool from our history, Token-2022 transfer fees and hooks, freeze authority, and a verdict (ok, high slippage risk, high sandwich risk, unknown) with reasons.
| Parameter | Type | Description |
|---|---|---|
amountrequired | number | Amount in quote units for buy, in token units for sell |
mintrequired | string | Token to buy or sell |
quote | string | Quote mint, SOL by default |
siderequired | buy | sell |
curl "https://api.dexra.dev/swap_preflight?amount=100&mint=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"e=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&side=buy" \
-H "Authorization: Bearer dxr_…"import { Dexra } from '@dexra/client'
const dexra = new Dexra({ apiKey: process.env.DEXRA_API_KEY })
const result = await dexra.swapPreflight({ amount: 100, mint: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263", quote: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", side: "buy" })
console.log(result.summary)import os
from dexra import Dexra
dexra = Dexra(api_key=os.environ["DEXRA_API_KEY"])
result = dexra.swap_preflight(amount=100, mint="DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263", quote="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", side="buy")
print(result["summary"]){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "swap_preflight",
"arguments": {
"amount": 100,
"mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"quote": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"side": "buy"
}
}
}