# Swaps Fordefi has integrated leading platforms to facilitate intent-based swaps or aggregated trading across decentralized finance (DeFi) from within Fordefi's web console and REST API. - For instructions in performing swaps using the web console, see [Swap Assets](/user-guide/swap). - For programmatic leverage of the swap aggregator API, you must call two endpoints: - [Get Quote](https://docs.fordefi.com/api/latest/openapi/swaps/get_quotes_api_v1_swaps_quotes_post) - [Create Transaction](https://docs.fordefi.com/api/latest/openapi/swaps/create_transaction_api_v1_swaps_post) - See a [complete example](https://github.com/FordefiHQ/api-examples/tree/main/python/swaps) showcasing our swap API and how to use it to manage quotes from multiple providers. Activate UniswapX If you want to use UniswapX as a quote provider, please contact Fordefi support to have this feature activated for your organization. ## Get quote First, you must receive a quote for the specific trade you wish to make. Pass the swap parameters, that is, the `origin vault`, the `input asset`, the `output asset`, and the `amount` of the input asset. Optionally, you can also specify the maximum slippage tolerance or ask for quotes from a subset of secific providers. To get the full list of supported providers, you can call the [Get Providers](https://docs.fordefi.com/api/latest/openapi/swaps/get_provider_ids_api_v1_swaps_provider_ids__chain_type__get) endpoint. ```json { "vault_id": "432b199b-1f71-42bf-ba0b-33d512afa9de", "input_asset_identifier": { "type": "evm", "details": { "type": "native", "chain": "ethereum_mainnet" } }, "output_asset_identifier": { "type":"evm", "details":{ "type":"erc20", "token":{ "chain":"ethereum_mainnet", "hex_repr":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" } } }, "amount": "1000000000000000000", "slippage_bps": "1000000000000000000" "requested_provider_ids": [] } ``` ## Submit the swap Once you have received a quote from at least one provider, you can submit the swap transaction by submitting the same swap parameters as in the quote request and the `quote_id` that you chose from the response. Note that if the swap transaction requires token approvals to make the swap, several transactions will be created on Fordefi according to the required approvals to make the swap. ```json { "quote_id": "3c071a1d-db86-46a7-9dc8-72ba3fbca992", "vault_id": "432b199b-1f71-42bf-ba0b-33d512afa9de", "input_asset_identifier": { "type": "evm", "details": { "type": "native", "chain": "ethereum_mainnet" } }, "output_asset_identifier": { "type":"evm", "details":{ "type":"erc20", "token":{ "chain":"ethereum_mainnet", "hex_repr":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" } } }, "amount": "1000000000000000000", "slippage_bps": "1000000000000000000" } ```