# Trade API

Quote and transaction-building endpoints for routed swaps.

## Get swap quote

> Get a routed swap quote for an exact input amount.

```json
{"openapi":"3.0.0","info":{"title":"Raydium Trade API","version":"1.0.0"},"tags":[{"name":"Trade API","description":"Quote and transaction-building endpoints for routed swaps."}],"servers":[{"url":"https://transaction-v1.raydium.io"}],"paths":{"/compute/swap-base-in":{"get":{"summary":"Get swap quote","description":"Get a routed swap quote for an exact input amount.","tags":["Trade API"],"parameters":[{"in":"query","name":"inputMint","required":true,"schema":{"type":"string"},"description":"Token mint address to swap from."},{"in":"query","name":"outputMint","required":true,"schema":{"type":"string"},"description":"Token mint address to swap to."},{"in":"query","name":"amount","required":true,"schema":{"type":"string"},"description":"Amount in base units, such as token decimals or lamports for SOL."},{"in":"query","name":"slippageBps","required":true,"schema":{"type":"number"},"description":"Slippage tolerance in basis points. For example, 50 = 0.5%."},{"in":"query","name":"txVersion","required":true,"schema":{"type":"string","enum":["V0","LEGACY"]},"description":"Transaction version."}],"responses":{"200":{"description":"Successful quote response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"success":{"type":"boolean"},"version":{"type":"string"},"data":{"type":"object","properties":{"swapType":{"type":"string"},"inputMint":{"type":"string"},"inputAmount":{"type":"string"},"outputMint":{"type":"string"},"outputAmount":{"type":"string"},"otherAmountThreshold":{"type":"string"},"slippageBps":{"type":"number"},"priceImpactPct":{"type":"number"},"referrerAmount":{"type":"string"},"routePlan":{"type":"array","items":{"type":"object","properties":{"poolId":{"type":"string"},"inputMint":{"type":"string"},"outputMint":{"type":"string"},"feeMint":{"type":"string"},"feeRate":{"type":"number"},"feeAmount":{"type":"string"},"remainingAccounts":{"type":"array","items":{"type":"string"}},"lastPoolPriceX64":{"type":"string"}}}}}}}}}}}}}}}}
```

## Enter swap

> Build one or more serialized swap transactions from a quote response.

```json
{"openapi":"3.0.0","info":{"title":"Raydium Trade API","version":"1.0.0"},"tags":[{"name":"Trade API","description":"Quote and transaction-building endpoints for routed swaps."}],"servers":[{"url":"https://transaction-v1.raydium.io"}],"paths":{"/transaction/swap-base-in":{"post":{"summary":"Enter swap","description":"Build one or more serialized swap transactions from a quote response.","tags":["Trade API"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["swapResponse","wallet","txVersion"],"properties":{"swapResponse":{"type":"object","description":"Response returned by the quote endpoint."},"wallet":{"type":"string","description":"User wallet public key."},"txVersion":{"type":"string","enum":["V0","LEGACY"],"description":"Transaction version."},"wrapSol":{"type":"boolean","description":"Wrap SOL to wSOL for the input leg."},"unwrapSol":{"type":"boolean","description":"Unwrap wSOL to SOL for the output leg."},"inputAccount":{"type":"string","description":"Input token account. Omit if the input is SOL."},"outputAccount":{"type":"string","description":"Output token account. Omit if the output is SOL."},"computeUnitPriceMicroLamports":{"type":"string","description":"Priority fee in micro-lamports."}}}}}},"responses":{"200":{"description":"Successful transaction build response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"string"},"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"transaction":{"type":"string","description":"Base64-encoded serialized transaction."}}}}}}}}}}}}}}
```
