Using the uniswap router contract swapExactTokensForTokensSupportingfeesOnTransfer to swap from the contract token to USDT.
A liquidity pool (and therefore an LP pair) exists for the token-USDT pair therefore I’m using the path address(this), USDT address. If I set the “to” to be address(this) I get an INVALID_TO error response, if I set it to another address the function works as expected. I can see in the pair.swap function in the uniswap contracts that this error is called when you’re trying to send to one of the parts of the pair, however this doesn’t get returned when you do the same with a WETH pair, using swapExactTokensForEthSupportingFeeOnTransferTokens, which calls the same swap function.
Why is this and is there any way round it other than to deliver the funds to a separate address and deal with them from there?