tradeByTargetAmount()
Trade target tokens for the least amount of source tokens possible
Last updated
Trade target tokens for the least amount of source tokens possible
Last updated
Trades to receive the exact amount of target tokens for as few source tokens as possible.
sourceToken
Token
The source token address
targetToken
Token
The target token address
targetAmount
uint256
The exact amount of tokens to receive
maxSourceAmount
uint256
The maximum amount of source tokens that can be used for the transaction to not revert
deadline
uint256
Unix timestamp after which the transaction will revert
beneficiary
address
The address receiving the target tokens
See for a list of common errors and how to resolve them.