Generate Swap Transaction
Generate complete transaction data for executing a token swap via the AKKA router. The endpoint performs a full exact quote (graph walk), validates the user’s token balance and allowance, and returns a ready-to-sign transaction object.
dstAmount is the precise expected output.Using the response
The response includes atx object that is ready to sign and broadcast:
Slippage recommendations
| Swap type | Recommended slippage |
|---|---|
| Stable-to-stable | 0.1 — 0.5% |
| Major tokens | 0.5 — 1% |
| Low-liquidity tokens | 1 — 5% |
Balance and allowance validation
Whenfrom is provided, the API validates:
- Balance: The wallet has enough tokens to cover the swap amount
- Allowance: The AKKA Router is approved to spend enough tokens
400 error with a descriptive message.Authorizations
API key for authentication. Contact AKKA on Telegram to obtain your key.
Path Parameters
Blockchain chain ID
999 999
Query Parameters
Source token contract address. Use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for the native token.
^0x[a-fA-F0-9]{40}$"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
Destination token contract address.
^0x[a-fA-F0-9]{40}$"0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb"
Amount to swap in the smallest unit (wei).
"1000000000000000000"
Wallet address executing the swap. When provided, the API validates that the wallet has sufficient token balance and allowance.
^0x[a-fA-F0-9]{40}$"0xD3C0F471488523b378F2D9C21939c97300c510F5"
Maximum acceptable slippage as a percentage. Range: 0 to 50. Recommended: 0.5 to 3 for most swaps.
0 <= x <= 501
Custom gas price in wei. If omitted, the current network gas price is used.
"1000000000"
Custom gas limit. If omitted, the API estimates gas with a 20% safety buffer.
500000
Include srcToken and dstToken metadata in the response.
Include estimated gas amount in the response.
Response
Swap transaction data generated successfully
Expected output amount in the smallest unit (wei)
"12723902882990271"
Ready-to-sign transaction object. Send this directly to the blockchain.
ABI-encoded transaction tuple (from, to, data, value, gasPrice, gas) as a hex string. Allows decoding and executing the swap without needing the contract ABI.
"0x..."
Source token information (when includeTokensInfo=true)
Destination token information (when includeTokensInfo=true)
Estimated gas amount (when includeGas=true)
"231973"
