Closed LordReya closed 1 year ago
Solved it. I forgot to use yarn build again
is there a reason why you have multiple dexes in the findOpp function? The original code works as intended i.e. maps protocols to the uniswapV3 or uniswapV2. So for example, if UniswapV3 is protocol 0, it will be case 0, etc.
So I have been continuing to make the bot profitable. It's finally working, however it still has some flaws. The config.ts says which of the protocols from my map should be used:
export const tradingRoutes: ITrade[] = [ { path: [ ERC20Token.USDC, ERC20Token.DAI, ERC20Token.USDC, ERC20Token.MATIC, ERC20Token.USDT, ERC20Token.WBTC, ERC20Token.LINK, ERC20Token.WMATIC, ERC20Token.WETH, ERC20Token.UNI, ERC20Token.AAVE, ERC20Token.CRV, ERC20Token.QI, ERC20Token.MANA, ERC20Token.BNB, ERC20Token.GRT, ], //add tokens! protocols: [1, 3, 6], //not working correctly. Only does Quoter and 2nd protocol amountIn: getBigNumber(20, ERC20Token.USDC.decimals), },
The trading finder uses these protocols to find arbitrage oppertunities:
That's the
findRouterFromProtocol
function:export const findRouterFromProtocol = (protocol: number) => { return uniswapRouter[Object.keys(uniswapRouter)[protocol]]; }
The protocols are read from the address file that was created here:
I don't know what exactly I did wrong, cause the only routers it actually pings from the protocol are the UniswapV3 and Quickswap router. Even after commenting them out, it still only calls these routers.
Any ideas how to call these Dexes in a better way maybe?