Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Why does the make_trade function take about 2 minutes to settle the swap? #334

sitwano started this conversation in General
Discussion options

Is this normal? Is everyone else experiencing the same issue? I am using the polygon network, but I suspect it will be the same on Eth mainnet. The swap goes through fine in the end... but just takes 2 whole minutes.

You must be logged in to vote

Replies: 2 comments

Comment options

Consider the following:

from web3 import middleware
from web3.gas_strategies.time_based import fast_gas_price_strategy
...
web3 = Web3(*YOUR_ENDPOINT*)
web3.eth.setGasPriceStrategy(fast_gas_price_strategy)
web3.middleware_onion.add(middleware.time_based_cache_middleware)
web3.middleware_onion.add(middleware.latest_block_based_cache_middleware)
web3.middleware_onion.add(middleware.simple_cache_middleware)
...
uniswap = Uniswap(*YOUR_PARAMS*, web3=web3)
You must be logged in to vote
0 replies
Comment options

Ah I see. Ok I will try it out. Btw, awesome project :) thank you very much for your contributions!

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.