Swaps
Reference for the DFNS Swaps API, which lets you execute token swaps across supported EVM chains through integrated providers like Uniswap.
Flow Overview
- Request a Quote: Retrieve estimated output amounts for a given swap (input token and amount, output token, provider and slippage tolerance).
- Submit the swap intent: Submit a request to Swap, based on the
quoteId - Approve policies: If using Wallet:Sign policies, review the transactions and approve them, due to the nature of a Swap transaction, you might be required to approve up to 4 signatures/transactions.
- Track Status: Monitor the Swap execution.
Swap object
Swap id.
1 - 64^swap-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$"swap-5ch70-fc3n7-3k2cbo8d7q5lnts4"
Id of the quote this swap is based on.
1 - 64^swapQuote-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$"swapQuote-7n9p0-cth75-6l74n2sj7u73ooeq"
Optional user-defined reference for this Swap.
Id of the DFNS wallet spending the sourceAsset.
1 - 64^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$"wa-5pfuu-9euek-h0odgb6snva8ph3k"
Id of the DFNS wallet receiving the target asset. Currently this value must be the same as the walletId.
1 - 64^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$"wa-5pfuu-9euek-h0odgb6snva8ph3k"
Swap status.
PendingPolicyApproval, InProgress, Completed, Failed, Rejected Swap provider.
UniswapX, UniswapClassic The source asset for this swap transaction.
- Native Asset
- EVM Fungible Token (ERC-20)
The target asset for this swap transaction.
- Native Asset
- EVM Fungible Token (ERC-20)
The slippage tolerance for this trade in basis point (BPS). Slippage tolerance defines the maximum price difference you are willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%.
The full request used for initiating this swap.
- Option 1
- Option 2
The user who initiated the request.
The failure reason, if any. Only present when status is Failed.