I want to swap from 0xdb25f211ab05b1c97d595516f45794528a807ad8
(EURS) to 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
(USDC) but the sellAmount
is not known upfront and is only known during contract execution.
I tried building the swap data using https://api.0x.org/swap/v1/quote?sellToken=0xdb25f211ab05b1c97d595516f45794528a807ad8&buyToken=USDC&sellAmount=277000. Passing it to the contract works if the contract has more tokens than the sellAmount
.
How do I create swap data when the value of sellAmount
is not known?
Edit: I don't know the buyAmount
as well, I want to sell everything that the wallet owns.