Im trying to get 0x API fees but I dont understand how matcha.xyz does it. I tried looking at 0x Instant, but the fees are too low and same for me when I use their API this is what Im getting (136000 x 5000..) but i dont understand how matcha gets it right : matchas max fee is usually 50 btw because I would normally specify medium priority and it would give me something like 54 Gwei PS: I do specify a takers address and a skipValidation:false Can anyone please help me on this
Instant has unfortunately not been updated to support EIP1559 style transactions. It uses https://ethgasstation.info/json/ethgasAPI.json for gas prices which is still providing legacy transaction gas prices.
The way that legacy transactions are handled post EIP1559 is that the priority fee and max gas price are both set to the value of the legacy gas price, this unfortunately leads to the user overpaying for the transaction.
The code for gas price fetching can be found here, if you would like to help fix this issue we welcome contributions to the Instant codebase. In that case please open an issue in the Instant repository and we can help you fix this issue 👍