I'm trying to fill a quote that I get from the 0x API:
const qs = createQueryString({
sellToken: 'TUSD',
buyToken: 'WETH',
sellAmount: BigInt(882693 * 10 ** 18)
});
..but the transaction reverts, even after successfully getting the quote (taker has the sell balance, allowance was granted, value of the fee is 0).
If I modify sellAmount
with:
BigInt(882693 * 10 ** 12)
:the swap runs but with less traded amount (obviously since TUSD is 18 decimals).882693 * 10 ** 18
: doesn't even get the quote (throws an error onsellAmount
).882693
: same problem as 1.
If I add includedSources: 'Uniswap_V2'
, for example, to the quote, the swap runs but with less traded amount while having just one order
in the quote:
But when running the original quote, I get two orders
instead so I think here is where it fails.
How do I fill this quote from the API that has two orders
? I looked through the API docs but couldn't find an answer.
Thanks for the help!