EatTheBlocks Forum

Profitable-flashloans #15: breaking changes with @uniswap/sdk

I was unable to run the code as described in
[https://github.com/jklepatch/eattheblocks/tree/master/profitable-flashloans/15-poll-uniswap-prices](http://Chapter 15)

After reviewing Uniswap’s documentation, just saw there seems to be breaking changes with version 3, so here is an update of the changes to be done in our code:

Before:

        Token.fetchData(
            ChainId.MAINNET,
            tokenAddress
        )

Now:

        new Token(
            ChainId.MAINNET,
            tokenAddress,
            18
        )

Before:

   const daiWeth = await Pair.fetchData(
       dai,
       weth
   );

Now:

   const daiWeth = await Fetcher.fetchPairData(
       dai,
       weth
   );

Also had issues with the lastest version, but using the one just before did work:

npm i @uniswap/sdk@3.0.2

Just for you to know!

1 Like