You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
When I exchange in TOKEN for WETH or WHET for a TOKEN, the result obtained with trade.outputAmount always gives me the same result as in the uniswap UI.
But when I go to obtain the output price in a TOKEN TRADE for another TOKEN erc-20 I get a different result. Always lower than the one offered by the uniswap UI at the same time.
My code
const TOKENP = new Token(ChainId.MAINNET, tokenw.hash, tokenw.decimals);
const TOKEN_M = new Token(ChainId.MAINNET, tokenm.hash, tokenm.decimals); //
const pair3 = await Fetcher.fetchPairData(TOKEN_M ,TOKEN_P);
const route3 = new Route([pair3], TOKEN_P);
let qtyToken = Math.pow(10, 18)*1;
const tradeM = new Trade(route3, new TokenAmount( TOKEN_P, qtyToken ), TradeType.EXACT_INPUT)
return tradeM.outputAmount.toSignificant(6);
Shouldn't this code give me the exact data from the uniswap UI just like it happens to me when I trade with ETH?
This difference increases when the amount of the input token increases. In this case this 1 unit.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When I exchange in TOKEN for WETH or WHET for a TOKEN, the result obtained with trade.outputAmount always gives me the same result as in the uniswap UI.
But when I go to obtain the output price in a TOKEN TRADE for another TOKEN erc-20 I get a different result. Always lower than the one offered by the uniswap UI at the same time.
My code
Shouldn't this code give me the exact data from the uniswap UI just like it happens to me when I trade with ETH?
This difference increases when the amount of the input token increases. In this case this 1 unit.
The text was updated successfully, but these errors were encountered: