# Swap

## Get the optimal and alternative routes with full transaction details.

> Get the optimal and alternative routes with full transaction details.

```json
{"openapi":"3.0.3","info":{"title":"Clypto API","version":"1.0.0"},"servers":[{"url":"https://api.clypto.com","description":"Production"},{"url":"http://localhost:8080","description":"Local Development"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"x-api-key","in":"header"}}},"paths":{"/v1/swap":{"get":{"summary":"Get the optimal and alternative routes with full transaction details.","tags":["Swap"],"description":"Get the optimal and alternative routes with full transaction details.","parameters":[{"schema":{"type":"string"},"in":"query","name":"srcChain","required":true,"description":"Source chain ID (e.g., bitcoin, solana, 1, 56 )"},{"schema":{"type":"string"},"in":"query","name":"srcToken","required":true,"description":"Source token contract address. Use an empty string for native assets."},{"schema":{"type":"string"},"in":"query","name":"destChain","required":true,"description":"Destination chain ID (e.g., bitcoin, solana, 1, 56 )"},{"schema":{"type":"string"},"in":"query","name":"destToken","required":true,"description":"Destination token contract address. Use an empty string for native assets."},{"schema":{"type":"string"},"in":"query","name":"amount","required":true,"description":"Amount of the source token to swap (in base units)"},{"schema":{"type":"string"},"in":"query","name":"srcAddress","required":true,"description":"Sender wallet address (used for generating transaction data)"},{"schema":{"type":"string"},"in":"query","name":"destAddress","required":true,"description":"Recipient wallet address (default: same as sender)"},{"schema":{"minimum":1,"maximum":10000,"type":"number"},"in":"query","name":"slippageBps","required":false,"description":"Maximum slippage in basis points (1% = 100 bps). Default behavior is provider-defined."},{"schema":{"type":"string"},"in":"query","name":"referrer","required":false,"description":"Referrer wallet address to receive a portion of the trade fee. Requires referralFeeBps to be set."},{"schema":{"minimum":1,"maximum":1000,"type":"number"},"in":"query","name":"referralFeeBps","required":false,"description":"Referral fee in basis points (max 1000 = 10%). Requires referrer to be specified."},{"schema":{"type":"string"},"in":"query","name":"provider","required":false,"description":"Comma-separated list of provider IDs to include in routing (e.g., \"thorchain,1inch,0x\")."},{"schema":{"type":"string"},"in":"query","name":"excludeProvider","required":false,"description":"Comma-separated list of provider IDs to exclude from routing (e.g., \"thorchain,1inch,0x\")."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"srcChain":{"description":"Source chain ID","type":"string"},"srcToken":{"description":"Source token address (or empty for native assets)","type":"string"},"destChain":{"description":"Destination chain ID","type":"string"},"destToken":{"description":"Destination token address (or empty for native assets)","type":"string"},"slippageBps":{"description":"Allowed slippage in basis points","type":"number"},"srcAmount":{"description":"Amount of source token to swap (in base units)","type":"string"},"srcAddress":{"description":"Sender wallet address","type":"string"},"destAddress":{"description":"Recipient wallet address","type":"string"},"referrer":{"description":"Referrer address to receive trading fees","type":"string"},"referralFeeBps":{"description":"Referral fee percentage in bps","type":"number"},"provider":{"type":"array","items":{"description":"List of providers to include","type":"string"}},"excludeProvider":{"type":"array","items":{"description":"List of providers to exclude","type":"string"}},"tokenMeta":{"type":"object","properties":{"srcToken":{"type":"object","properties":{"address":{"description":"Contract address of the token","type":"string"},"chainId":{"description":"ID of the blockchain network the token belongs to","type":"string"},"decimals":{"description":"Number of decimals the token uses (e.g., 18 for ETH)","type":"number"},"logoURI":{"description":"URL to the token's logo image","type":"string"},"name":{"description":"Human-readable token name (e.g., \"Ethereum\")","type":"string"},"symbol":{"description":"Token symbol (e.g., \"ETH\")","type":"string"}},"required":["address","chainId","decimals","name","symbol"]},"destToken":{"type":"object","properties":{"address":{"description":"Contract address of the token","type":"string"},"chainId":{"description":"ID of the blockchain network the token belongs to","type":"string"},"decimals":{"description":"Number of decimals the token uses (e.g., 18 for ETH)","type":"number"},"logoURI":{"description":"URL to the token's logo image","type":"string"},"name":{"description":"Human-readable token name (e.g., \"Ethereum\")","type":"string"},"symbol":{"description":"Token symbol (e.g., \"ETH\")","type":"string"}},"required":["address","chainId","decimals","name","symbol"]}},"required":["srcToken","destToken"]},"bestRoute":{"type":"object","properties":{"provider":{"description":"ID of the provider used for the swap","type":"string"},"destAmount":{"description":"Expected destination amount post-swap","type":"string"},"minDestAmount":{"description":"Minimum guaranteed destination amount accounting for slippage","type":"string"},"eta":{"description":"Estimated execution time for the transaction (in seconds)","type":"number"},"tx":{"type":"object","properties":{"from":{"description":"Sender wallet address","type":"string"},"to":{"description":"Destination contract or wallet address","type":"string"},"data":{"description":"Encoded transaction call data (hex format)","type":"string"},"value":{"description":"Amount of native token to send (in wei or base units)","type":"string"},"gasPrice":{"description":"Gas price to use for the transaction (in wei)","type":"string"},"gasRate":{"description":"Gas rate to use for the utxo or solana transaction","type":"string"},"gasLimit":{"description":"Maximum gas allowed for the transaction","type":"string"}}},"meta":{"type":"object","properties":{"providerLogoURI":{"description":"URL of the provider logo image","type":"string"},"explorerUrl":{"description":"Explorer URL to view the swap transaction or route details","type":"string"},"notes":{"description":"Additional notes or comments about the provider","type":"string"},"extra":{"description":"Any additional metadata provided by the aggregator or api"}},"required":["providerLogoURI","explorerUrl"]},"tags":{"description":"Route classification tags (e.g., Best, Fastest)","type":"array","items":{"anyOf":[{"type":"string","enum":["Fastest"]},{"type":"string","enum":["Best"]}]}}},"required":["provider","destAmount","eta","tx","meta","tags"]},"routes":{"description":"List of all executable route options with transaction data","type":"array","items":{"type":"object","properties":{"provider":{"description":"ID of the provider used for the swap","type":"string"},"destAmount":{"description":"Expected destination amount post-swap","type":"string"},"minDestAmount":{"description":"Minimum guaranteed destination amount accounting for slippage","type":"string"},"eta":{"description":"Estimated execution time for the transaction (in seconds)","type":"number"},"tx":{"type":"object","properties":{"from":{"description":"Sender wallet address","type":"string"},"to":{"description":"Destination contract or wallet address","type":"string"},"data":{"description":"Encoded transaction call data (hex format)","type":"string"},"value":{"description":"Amount of native token to send (in wei or base units)","type":"string"},"gasPrice":{"description":"Gas price to use for the transaction (in wei)","type":"string"},"gasRate":{"description":"Gas rate to use for the utxo or solana transaction","type":"string"},"gasLimit":{"description":"Maximum gas allowed for the transaction","type":"string"}}},"meta":{"type":"object","properties":{"providerLogoURI":{"description":"URL of the provider logo image","type":"string"},"explorerUrl":{"description":"Explorer URL to view the swap transaction or route details","type":"string"},"notes":{"description":"Additional notes or comments about the provider","type":"string"},"extra":{"description":"Any additional metadata provided by the aggregator or api"}},"required":["providerLogoURI","explorerUrl"]},"tags":{"description":"Route classification tags (e.g., Best, Fastest)","type":"array","items":{"anyOf":[{"type":"string","enum":["Fastest"]},{"type":"string","enum":["Best"]}]}}},"required":["provider","destAmount","eta","tx","meta","tags"]}}},"required":["srcChain","srcToken","destChain","destToken","slippageBps","srcAmount","srcAddress","destAddress","tokenMeta","bestRoute","routes"]}}}}}}}}}
```
