Skip to content

feat: added Optimism and Arbitrum support (updated constants.py)#186

Merged
ErikBjare merged 2 commits into
uniswap-python:masterfrom
liquid-8:master
Oct 25, 2021
Merged

feat: added Optimism and Arbitrum support (updated constants.py)#186
ErikBjare merged 2 commits into
uniswap-python:masterfrom
liquid-8:master

Conversation

@liquid-8

Copy link
Copy Markdown
Member

Closes #185
Closes #183
Closes #176

@romanbsd

Copy link
Copy Markdown
Contributor

Also 421611 => "arbitrum_testnet"

@romanbsd

Copy link
Copy Markdown
Contributor

BTW, I'm using uniswap-python on arbitrum, and I had to monkey patch _get_tx_params and remove the "gas" parameter, otherwise I was receiving "insufficient funds for gas". Perhaps it's something specific to my setup, but I thought that it might be useful for others if they also face such problem.

@liquid-8

Copy link
Copy Markdown
Member Author

I've checked some uni swaps on arbitrum and it turns out txn requires gas spendings ~1m but _get_tx_param has hardcoded 250k limit. So I'm quite sure it isn't about your setup.

@romanbsd

Copy link
Copy Markdown
Contributor

Yes, I can testify: 1,078,834
I wasn't sure that it's not something specific to my case. I'm curious why it's different from L1 gas usage.

@ErikBjare

ErikBjare commented Oct 25, 2021

Copy link
Copy Markdown
Member

BTW, I'm using uniswap-python on arbitrum, and I had to monkey patch _get_tx_params and remove the "gas" parameter, otherwise I was receiving "insufficient funds for gas".

Perhaps the gas parameter could be removed entirely from _get_tx_params? Perhaps we should use estimate_gas instead?

I wasn't sure that it's not something specific to my case. I'm curious why it's different from L1 gas usage.

Could it be because each LP position is smaller, and this impacts gas efficiency? (just guessing) Edit: Nevermind, answers here https://developer.offchainlabs.com/docs/arbgas

@ErikBjare

Copy link
Copy Markdown
Member

Merging this for now, we'll deal with any issues in future PRs.

@ErikBjare ErikBjare changed the title Update constants.py; added Optimism and Arbitrum support feat: added Optimism and Arbitrum support (updated constants.py) Oct 25, 2021
@ErikBjare ErikBjare merged commit 754fbc8 into uniswap-python:master Oct 25, 2021
@romanbsd

Copy link
Copy Markdown
Contributor

Uniswap3 suggest doing 1.2 * estimateGas. I can make a PR if you want.

@ErikBjare

Copy link
Copy Markdown
Member

@romanbsd That would be appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Arbitrum One

3 participants