-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
The this.ethereum of uniswapLP is not initialized. #228
Comments
Hi, |
The problem is similar to this issue. It seems that the UniswapLPHelper is not creating the correct object when the chain is Polygon. my solution is check the chain and create a correct Object for this.ethereum uniswap.lp.helper.ts constructor(chain: string, network: string) {
if (chain === 'ethereum') {
this.ethereum = Ethereum.getInstance(network);
} else if (chain === 'polygon') {
this.ethereum = Polygon.getInstance(network);
} else {
throw new Error('Chain not supported');
} |
Hey, does the solution works for you? |
@johna1203 @emusol what chain and network are you trying to connect to? |
hey the error is when I try to work with polygon, on arbitrum it work perfectly |
@emusol So reconnect to uniswapLP using |
|
Sorry for the delay, The code I wrote above worked, I had to add a check for Polygon. |
This error does not happen to me. What version of the gateway are you using? |
In fact, it is not an error... you are choosing the wrong network In the question "Which chain do you want uniswapLP...." you need to choose polygon instead of ethereum. |
When I use uniswapLP in a script, this.ethereum.storedTokenList is always empty. I researched the reason and found a possibility of a bug.
It appears that this.ethereum.init() is not being called, meaning it is not being initialized. This prevents it from loading tokens.
I changed 3 lines in uniswap.lp.helper.ts and it worked for me.
Steps To Reproduce
1, create a Script with
markets = {"uniswapLP_polygon_mainnet": "XXXX-XXX"}
2, then, call the
await self.connectors["uniswapLP_polygon_mainnet"].get_price(trading_pair, fee_tier)
Screenshots
uniswap.lp.helper.ts
Release version
{
"name": "hummingbot-gateway",
"version": "1.21.0",
}
uniswap.lp.helper.ts
Here is a solution that is working for me. I am calling await this.ethereum.init(); if ethereum is not ready.
Optional: your discord username:johna1203
The text was updated successfully, but these errors were encountered: