Buy exact amount
This endpoint allows users to trade a variable amount of one token to receive an exact amount of another token using the Uniswap protocol.
The transaction is executed on the specified blockchain network, and the user must provide the necessary transaction details, including the token to buy, the token to pay with, and the exact amount to receive. If the token being paid with is WETH and needs to be wrapped, the appropriate amount will be wrapped automatically.
Body
Request model for buying exactly an amount of tokens.
The symbol of the token to swap from Note the supported tokens per chain.
1INCH
, AAVE
, BAL
, cbBTC
, cbETH
, CRV
, crvUSD
, DAI
, ENS
, ETHx
, FRAX
, FXS
, GHO
, KNC
, LDO
, LINK
, LUSD
, MKR
, osETH
, PYUSD
, rETH
, RPL
, rsETH
, sDAI
, SNX
, STG
, sUSDe
, tBTC
, UNI
, USDC
, USDe
, USDS
, USDT
, WBTC
, weETH
, WETH
, wstETH
, ARB
, EURS
, MAI
, USDCe
, AERO
, EUR
, VIRTUAL
The symbol of the token to swap to Note the supported tokens per chain.
1INCH
, AAVE
, BAL
, cbBTC
, cbETH
, CRV
, crvUSD
, DAI
, ENS
, ETHx
, FRAX
, FXS
, GHO
, KNC
, LDO
, LINK
, LUSD
, MKR
, osETH
, PYUSD
, rETH
, RPL
, rsETH
, sDAI
, SNX
, STG
, sUSDe
, tBTC
, UNI
, USDC
, USDe
, USDS
, USDT
, WBTC
, weETH
, WETH
, wstETH
, ARB
, EURS
, MAI
, USDCe
, AERO
, EUR
, VIRTUAL
The swap fee of the pool
0.01
, 0.05
, 0.3
, 1.0
The amount of the token to swap to
x > 0
1.5
The maximum amount of the token to swap from
x >= 0
1.6
The chain to use.
base:mainnet
, ethereum:mainnet
, arbitrum:mainnet
The address of the transaction sender
Whether to wrap ETH to WETH, only use when swapping WETH into something
true
Response
The chain id of the transaction
The data of the transaction
The sender of the transaction
The gas of the transaction
The recipient of the transaction
The value of the transaction
The nonce of the address
The max fee per gas of the transaction
The max priority fee per gas of the transaction
Was this page helpful?