Swap

Executes token swaps within a yield aggregator protocol, providing transaction metadata (chain ID, addresses, gas, reference ID). Configurable slippage, swap path, and gas priority let users tailor swaps to market conditions.

💡

Compute Unit Value: 95 (Fixed)

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

The request body for a /defi/v1/yieldaggregator/swap

The request body for a /defi/v1/yieldaggregator/swap

string
enum

The unique identifier used to route queries or transactions to the correct yield aggregator.

Allowed:
string
required

The blockchain address of the source yield market from which the tokens will be swapped. This address directs the swap to the appropriate liquidity pool within the aggregator.

string
required

Blockchain address of the sender. For EVM chains, use a checksummed hex address (e.g., 0xABCDEF...). This address must hold sufficient balance and will sign the transaction.

path
array of strings
required

Ordered array of token contract addresses defining the swap route from input to output. Provide [tokenInAddress, tokenOutAddress] for a direct swap. Example (WETH→USDC): ['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'].

path*
string
required

Amount of the input token to provide, specified in the token's smallest denomination (base units). Do not send human-readable decimal values. Examples: to swap 1 WETH (18 decimals), use "1000000000000000000"; to swap 1 USDC (6 decimals), use "1000000".

string

The maximum allowable percentage deviation between the expected and executed swap price. Default is 1, meaning a 1% tolerance (acceptable range: 0 to 100).

string

Maximum number of gas units to allocate for the transaction, as an integer string (e.g., '200000'). If omitted, gas is estimated automatically. Note: this is gas units, not wei or gwei.

boolean

Enable swap aggregator functionality to facilitate swaps between tokens that are not directly convertible with the underlying asset. Set this boolean flag to true to activate advanced routing logic for such conversions.

string

Specifies the desired gas fee priority for the transaction. Acceptable values include 'low', 'medium', or 'high', and this setting can influence the speed and cost of the swap.

boolean

Flag to include a basis points fee transaction alongside the main transaction when set to true.

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json