Request Swap Quote
Requests a quote from a specified swap provider for exchanging assets. This is the first step in the swap flow and returns an estimated price and parameters for performing the swap transaction.
- HTTP request
- POST/swaps/quotes
- Authorization requirements
-
Header Type Required Description Authorizationstring Yes Bearer token used to authenticate the request. See Authentication flows for instructions on generating this token. - Request body
-
Field Type Required Description provider string Yes Swap provider. One of UniswapX or UniswapClassic. walletId string Yes ID of the IBM Digital Asset Haven wallet spending the sourceAsset. Length must be between 1 and 64 characters.sourceAsset object Yes Asset being spent in the swap. Uses the same structure as the Transfer API. targetAsset object Yes Asset being received in the swap. Uses the same structure as sourceAssetbut does not include an amount field.slippageBps number Yes Slippage tolerance for this trade, in basis points. Slippage tolerance defines the maximum acceptable price movement relative to the quoted estimate. One basis point equals 0.01 percent. targetWalletId string No ID of the wallet receiving the target asset. Must currently be the same as walletId. If omitted, it defaults towalletId. Length must be between 1 and 64 characters.Supported asset types- Native Asset
- EVM Fungible Token (ERC‑20)
curl --request POST \ --url https://api.digitalassets.ibm.com/swaps/quotes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "walletId": "wa-3l3cj-l8mq7-8q78f9nopq7f1qjv", "targetWalletId": "wa-3l3cj-l8mq7-8q78f9nopq7f1qjv", "provider": "UniswapClassic", "sourceAsset": { "kind": "Native", "amount": "1000000000000000000" }, "targetAsset": { "kind": "Erc20", "contract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" }, "slippageBps": 50 } ' - Response
- 200: Success
Example response:
{ "id": "swapQuote-3hgv4-q8tbf-8v2ajmrbmg6m4i9t", "walletId": "wa-3l3cj-l8mq7-8q78f9nopq7f1qjv", "targetWalletId": "wa-3l3cj-l8mq7-8q78f9nopq7f1qjv", "provider": "UniswapClassic", "sourceAsset": { "kind": "Native", "amount": "10000000000", "metadata": { "network": "EthereumSepolia", "name": "Ethereum", "symbol": "SepoliaETH", "decimals": 18, "tid": "native:eth" } }, "targetAsset": { "kind": "Erc20", "contract": "0xda0be7efd234295395d4204d0df4358339b57b27", "amount": "6467571553831928182", "metadata": { "network": "EthereumSepolia", "name": "Test", "symbol": "Test", "decimals": 18, "tid": "erc20:0xda0be7efd234295395d4204d0df4358339b57b27" } }, "slippageBps": 100, "dateCreated": "2025-09-11T10:52:15.039Z", "requestBody": { "provider": "UniswapClassic", "walletId": "wa-3l3cj-l8mq7-8q78f9nopq7f1qjv", "targetWalletId": "wa-3l3cj-l8mq7-8q78f9nopq7f1qjv", "sourceAsset": { "kind": "Native", "amount": "10000000000" }, "targetAsset": { "kind": "Erc20", "contract": "0xda0be7efd234295395d4204d0df4358339b57b27" }, "slippageBps": 100 }, "requester": { "userId": "us-48r5q-eshfg-9pmr2lo6bmpr4i4i", "tokenId": "to-4etah-smoal-9n3rmhul4dpaueg5" } }