0

we are building a swap tokens feature using your API to get the quotes data. The reason is the inability to provide adequate gas value to Metamask on Polygon (other chains work fine) We wonder how actually the gas value is inserted to Metamask, is it stored in DATA?

We did some testing, and found out that when when we don't send the DATA to Metamask, it takes by default the middle option in Metamask gas setting.

If we do send the DATA to metamask, the gas isn't adequate, and the user cannot sign the transaction. (Only if he choose the gas manually)

The call https://polygon.api.0x.org/swap/v1/quote?sellToken=MATIC&buyToken=USDC&sellAmount=1000000000000000000

enter image description here enter image description here

1 Answer 1

0

Polygon uses the new EIP 1559 which needs the following fields: maxFee and maxPriorityFee to calculate gas. You can use this service from Polygon team to send gas values to Metamask: https://wiki.polygon.technology/docs/develop/tools/polygon-gas-station/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.