Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: estimated cost of gas for transaction #64

Open
perryascott opened this issue Jul 15, 2023 · 3 comments
Open

enhancement: estimated cost of gas for transaction #64

perryascott opened this issue Jul 15, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@perryascott
Copy link

The user should be able to create a new Transaction object and estimate how much gas it will cost to execute the transaction.

Ideally, less information is required to retrieve this information. I'm ill-informed on the variables that go into gas cost. If it's possible, maybe the user only needs to provide the following to a function:

  • number of orders
  • whether it's an offer/cancel
  • pair

To receive an estimate of the gas cost.

@adamamsmith
Copy link
Contributor

Hi @perryascott

We pushed an update to the repo recently whereby if gas is not passed in the Transaction object then when placing the transaction the gas cost is automatically estimated.

This has the additional benefit of verifying that the transaction would occur successfully on chain.

The update in question is here: #56

As such if you are currently passing gas values to transactions you should be able to remove this.

I'm not sure but this may solve what you are talking about above.

However I can also look at exposing the estimate_gas call on a transaction. However, I would need to look into how to do this. Let me know if you want me to look into this

@adamamsmith adamamsmith self-assigned this Jul 17, 2023
@adamamsmith adamamsmith added the enhancement New feature or request label Jul 17, 2023
@denverbaumgartner
Copy link
Contributor

Hi @perryascott

We pushed an update to the repo recently whereby if gas is not passed in the Transaction object then when placing the transaction the gas cost is automatically estimated.

This has the additional benefit of verifying that the transaction would occur successfully on chain.

The update in question is here: #56

As such if you are currently passing gas values to transactions you should be able to remove this.

I'm not sure but this may solve what you are talking about above.

However I can also look at exposing the estimate_gas call on a transaction. However, I would need to look into how to do this. Let me know if you want me to look into this

@adamamsmith from my understanding, the goal here would be to expose the estimated gas cost to the user before the transaction is actually executed. that way, they can build more responsive systems that are more gas conscious, correct me if i am wrong @perryascott. today, we ship the transaction before giving the user the chance to check the estimated gas cost.

@perryascott
Copy link
Author

Hey @adamamsmith,

Thanks for the well thought out answer. That's exactly what I need. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants