gnosis / cowswap

🐮 CowSwap: First Gnosis Protocol v2 UI
https://gnosis.io
GNU General Public License v3.0
113 stars 55 forks source link

Use our own Gas Estimation #708

Open anxolin opened 3 years ago

anxolin commented 3 years ago

From last test session

If possible to suggest gas price we should suggest a higher one as default is too low (e.g. on Opeara Mobile)

Suggestion Add the average gas price in all Ethereum transactions instead of relying in the Wallet.

Nice to have We could suggest a gas price. Some UIs also allow you to choose slow/medium/fast which is great. This could even be done together with this proposal #571 so we, for Ethereum TX we present a nice UX where user selects his gas price. For meta-transactions we could use the gas price to show how much you are saving in gas.

anxolin commented 3 years ago

I think Metamask not always estimate right. We could improve the UX by selecting a better gas.

Also, maybe some UI helps, showing current gasprices? it was suggested. For wrapping/unwrapping/approving ideally we would let the user choose between FAST/AVERAGE/SLOW

gasnow is quite reliable afait

anxolin commented 3 years ago

@nenadV91 I just assigned you a task that I think can be nice to start with:

David could help u if u need to find yourself around. It would be to make sure we add a gasPrice to all Ethereum transactions (wrap/unwrap/approve).

Basically: Get an estimation from some external source: i.e. https://www.gasnow.org . In case of error, we can have some fallback logic use that to fill the gasPrice field in the transactions

Note that we already have one way to get the gasprice right now, using another API (Safe relayer). So u can try to do something similar for this other service.

Also, note orders are not Ethereum transactions, so no need to add gasPRice there.

anxolin commented 3 years ago

This issue is outdated! specially because gasnow is deprecated now, but also because they don't implement EIP1559 gas estimations

If we use an estimation service, we should try to use one supporting the EIP.

One that looks great we could use: https://www.blocknative.com/gas-estimator

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you think it shouldn't be closed, speak now or forever hold your peace.