This endpoint calculates the amount of input tokens required to purchase a specified amount of output tokens from a Uniswap pool.
It also provides the resulting price after the transaction. The calculation takes into account the current pool state and the specified fee tier.
Documentation Index
Fetch the complete documentation index at: https://docs.compasslabs.ai/llms.txt
Use this file to discover all available pages before exploring further.
arbitrum, base, ethereum The symbol or address of the token to swap from. A token identifier - either a supported symbol (e.g., USDC, WETH) or a valid Ethereum address (0x...)
"USDC"
"WETH"
"0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8"
The symbol or address of the token to swap to. A token identifier - either a supported symbol (e.g., USDC, WETH) or a valid Ethereum address (0x...)
"USDC"
"WETH"
"0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8"
The fee to pay for the swap The transaction fee of a Uniswap pool in bips.
Uniswap supports 4 different fee levels.
0.01, 0.05, 0.3, 1.0 The amount of the token to swap from
x > 0Successful Response