Disclaimer: I don't think this is the correct method to calculate the price impact but it's almost 100% accurate for price impacts of less than 1%. This calculation method assumes that multi-hop is disabled i.e. swapping is restricted to direct pairs. I've only tested this calculation method on PancakeSwap and it is less accurate for larger trade sizes ...
Yes, it's possible. You can directly interact with UniswapV3 or Sushiswap router contracts to swap ETH to DAI and send that to a particular receiver address.
Here's the example with Sushiswap (UniswapV2) router:
payableAmount: ETH amount you want to swap
path: [WETH, DAI]
If you're swapping tokens with hard coded tax inside on their smart contract (in your case 10%). The "minimum token" appearing on the website is wrong, because it is based on normal token contract with no tax/fees.
Iv run into similar issues.
In your truffle configuration file, make sure you enable optimization i. The compiler settings. Setting to 200 is fine. Essentially the fact that the contract code isn't optimized, you end up running out of gas
Hope this helps,